mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 18:02:50 +02:00
Add & join teams
This commit is contained in:
@ -43,6 +43,16 @@ class JoinTeam(forms.Form):
|
||||
max_length=6,
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
|
||||
team = Team.objects.filter(access_code=cleaned_data["access_code"])
|
||||
if not team.exists():
|
||||
self.add_error('access_code', _("This access code is invalid."))
|
||||
cleaned_data["team"] = team.get()
|
||||
|
||||
return cleaned_data
|
||||
|
||||
|
||||
class SolutionForm(forms.ModelForm):
|
||||
problem = forms.ChoiceField(
|
||||
|
Reference in New Issue
Block a user