[WEI] Fix registration update
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
3532846c87
commit
81e708a7e3
2 changed files with 18 additions and 13 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue