Skip to content
Snippets Groups Projects
Verified Commit 5a05997d authored by ynerant's avatar ynerant
Browse files

Fix date comparison when checking a membership from the parent club


Signed-off-by: ynerant's avatarynerant <ynerant@crans.org>
parent c109cd3d
No related branches found
No related tags found
1 merge request!147Fix memberships
Pipeline #8845 passed with stages
in 9 minutes and 50 seconds
......@@ -658,8 +658,8 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView):
if club.name != "Kfet" and club.parent_club and not Membership.objects.filter(
user=form.instance.user,
club=club.parent_club,
date_start__gte=club.parent_club.membership_start,
date_end__lte=club.parent_club.membership_end,
date_start__lte=timezone.now(),
date_end__gte=club.parent_club.membership_end,
).exists():
form.add_error('user', _('User is not a member of the parent club') + ' ' + club.parent_club.name)
error = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment