clubs: adapt tests to new display and fix form validation issue for start_date

This commit is contained in:
2019-04-25 17:31:42 +02:00
parent 3eb3565a63
commit 68f61a432a
3 changed files with 35 additions and 18 deletions

View File

@ -397,6 +397,10 @@ class ClubMemberForm(forms.Form):
"""
cleaned_data = super(ClubMemberForm, self).clean()
if "start_date" in cleaned_data and not cleaned_data["start_date"]:
# Drop start_date if allowed to edition but not specified
cleaned_data.pop("start_date")
if not cleaned_data.get("users"):
# No user to add equals no check needed
return cleaned_data