Don't check if the user is a member of the parent club if there is no parent club

This commit is contained in:
Yohann D'ANELLO 2020-09-18 13:35:55 +02:00
parent bcd96b2ed8
commit 60f2a73cc5
1 changed files with 1 additions and 1 deletions

View File

@ -635,7 +635,7 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView):
error = True
# Must join the parent club before joining this club, except for the Kfet club where it can be at the same time.
if club.name != "Kfet" and not Membership.objects.filter(
if club.name != "Kfet" and club.parent_club and not Membership.objects.filter(
user=form.instance.user,
club=club.parent_club,
date_start__lte=club.parent_club.membership_start,