[WEI] Fix registration update

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-09-11 14:20:38 +02:00
parent 3532846c87
commit 81e708a7e3
No known key found for this signature in database
GPG key ID: 3A75C55819C8CF85
2 changed files with 18 additions and 13 deletions

View file

@ -118,7 +118,8 @@ class WEIMembershipForm(forms.ModelForm):
def clean(self):
cleaned_data = super().clean()
if cleaned_data["team"] is not None and cleaned_data["team"].bus != cleaned_data["bus"]:
if 'team' in cleaned_data and cleaned_data["team"] is not None \
and cleaned_data["team"].bus != cleaned_data["bus"]:
self.add_error('bus', _("This team doesn't belong to the given bus."))
return cleaned_data