mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 03:58:26 +02:00
Users can't join a team after validation
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -54,6 +54,10 @@ class JoinTeamForm(forms.ModelForm):
|
||||
access_code = self.cleaned_data["access_code"]
|
||||
if not Team.objects.filter(access_code=access_code).exists():
|
||||
raise ValidationError(_("No team was found with this access code."))
|
||||
else:
|
||||
team = Team.objects.get(access_code=access_code)
|
||||
if team.participation.valid is not None:
|
||||
raise ValidationError(_("The team is already validated or the validation is pending."))
|
||||
return access_code
|
||||
|
||||
def clean(self):
|
||||
|
Reference in New Issue
Block a user