1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Users that are not member of the club Kfet can't have a negative balance

This commit is contained in:
Yohann D'ANELLO
2020-04-01 17:00:06 +02:00
parent 92ab5ee3af
commit 356c8588e7
2 changed files with 21 additions and 4 deletions

View File

@ -228,8 +228,8 @@ class Membership(models.Model):
if Membership.objects.filter(
user=self.user,
club=self.club,
date_start__lte=datetime.datetime.now().date(),
date_end__gte=datetime.datetime.now().date(),
date_start__lte=self.date_start,
date_end__gte=self.date_start,
).exists():
raise ValidationError(_('User is already a member of the club'))