1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00

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

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,