From 60f2a73cc512e58b9f00e973e007585fa1e89fca Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 18 Sep 2020 13:35:55 +0200 Subject: [PATCH] Don't check if the user is a member of the parent club if there is no parent club --- apps/member/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/member/views.py b/apps/member/views.py index 13a4736e..42bf98e4 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -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,