1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 17:42:24 +00:00

Fix join team

This commit is contained in:
Yohann D'ANELLO 2020-05-05 16:14:02 +02:00
parent 613fe2447d
commit 5c8c0b3e5c

View File

@ -122,11 +122,11 @@ class JoinTeamView(LoginRequiredMixin, FormView):
form.add_error('access_code', _("You are already in a team.")) form.add_error('access_code', _("You are already in a team."))
return self.form_invalid(form) return self.form_invalid(form)
if self.request.user.role == '2coach' and team.encadrants.size() == 3: if self.request.user.role == '2coach' and len(team.encadrants) == 3:
form.add_error('access_code', _("This team is full of coachs.")) form.add_error('access_code', _("This team is full of coachs."))
return self.form_invalid(form) return self.form_invalid(form)
if self.request.user.role == '3participant' and team.participants.size() == 5: if self.request.user.role == '3participant' and len(team.participants.size()) == 5:
form.add_error('access_code', _("This team is full of participants.")) form.add_error('access_code', _("This team is full of participants."))
return self.form_invalid(form) return self.form_invalid(form)