Rework team creation constraints #5003
Merged
+69
−61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This PR switches upsert used for creating team membership in
Teams.get_or_create/1
to the newly introduced constraint which opens up the capability of user being a member in more than one team. The final step to follow will be removal of theone_team_per_user
constraint. Only after this it will be possible to implement and test the rest of the logic relying on that constraint being loosened.The change in question is done in 2910de3 while a1e97b5 is purely a refactor moving
Auth.GracePeriod
underTeams.GracePeriod
and correcting phrasing of the docs strings which were out of date.Depends on #5002