You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up when one user somehow became the owner of two teams. I'm guessing what happened was that he made the league and made his team the last team. So he was made the owner of the first team (because the system automatically does that at the moment) and then he joined with his team, so he was made the owner of that one as well.
Fixing issue #3 should alleviate that specific case, but it doesn't prevent a user from accidentally joining the league using the link .
I can't use a unique constraint for this at the moment, because teamOwnerId is currently a Maybe UserId and Yesod doesn't allow unique constraints for nullable fields. This would probably come for free with implementing issue #15, since team owner would likely be a separate table, a constraint like UniqueTeamOwnerLeagueIdUserId would suffice.
However, a request should probably check if there's an entry for the leagueIduserId pair and render an alert that says something like "this person already owns a team in the league", rather than just spitting out a unique constraint error.
The text was updated successfully, but these errors were encountered:
This came up when one user somehow became the owner of two teams. I'm guessing what happened was that he made the league and made his team the last team. So he was made the owner of the first team (because the system automatically does that at the moment) and then he joined with his team, so he was made the owner of that one as well.
Fixing issue #3 should alleviate that specific case, but it doesn't prevent a user from accidentally joining the league using the link .
I can't use a unique constraint for this at the moment, because
teamOwnerId
is currently aMaybe UserId
and Yesod doesn't allow unique constraints for nullable fields. This would probably come for free with implementing issue #15, since team owner would likely be a separate table, a constraint likeUniqueTeamOwnerLeagueIdUserId
would suffice.However, a request should probably check if there's an entry for the
leagueId
userId
pair and render an alert that says something like "this person already owns a team in the league", rather than just spitting out a unique constraint error.The text was updated successfully, but these errors were encountered: