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

Improve WEI UI

This commit is contained in:
Yohann D'ANELLO
2020-04-18 03:27:12 +02:00
parent d7da876a23
commit 0c9409fd4b
8 changed files with 105 additions and 22 deletions

View File

@ -27,6 +27,10 @@ class WEIClub(Club):
verbose_name=_("date end"),
)
@property
def is_current_wei(self):
return not WEIClub.objects.filter(date_start__gt=self.date_start).exists()
def update_membership_dates(self):
"""
We can't join the WEI next years.
@ -216,6 +220,13 @@ class WEIRegistration(models.Model):
"""
self.information_json = json.dumps(information)
@property
def is_validated(self):
try:
return self.membership is not None
except KeyError:
return False
def __str__(self):
return str(self.user)