mirror of https://gitlab.crans.org/bde/nk20
Fix date comparison when checking a membership from the parent club
Signed-off-by: ynerant <ynerant@crans.org>
This commit is contained in:
parent
c109cd3ddd
commit
5a05997d9d
|
@ -658,8 +658,8 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView):
|
||||||
if club.name != "Kfet" and club.parent_club and not Membership.objects.filter(
|
if club.name != "Kfet" and club.parent_club and not Membership.objects.filter(
|
||||||
user=form.instance.user,
|
user=form.instance.user,
|
||||||
club=club.parent_club,
|
club=club.parent_club,
|
||||||
date_start__gte=club.parent_club.membership_start,
|
date_start__lte=timezone.now(),
|
||||||
date_end__lte=club.parent_club.membership_end,
|
date_end__gte=club.parent_club.membership_end,
|
||||||
).exists():
|
).exists():
|
||||||
form.add_error('user', _('User is not a member of the parent club') + ' ' + club.parent_club.name)
|
form.add_error('user', _('User is not a member of the parent club') + ' ' + club.parent_club.name)
|
||||||
error = True
|
error = True
|
||||||
|
|
Loading…
Reference in New Issue