1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-07 09:44:01 +02:00

Fix adherents name

This commit is contained in:
Alexandre Iooss
2019-08-10 16:22:04 +02:00
parent 2ce5e122a4
commit 79ad58997a
5 changed files with 18 additions and 18 deletions

View File

@ -44,10 +44,10 @@ class User(AbstractUser):
REQUIRED_FIELDS = ['first_name', 'last_name', 'email']
@property
def is_adherent(self):
last_adh_year = Adhesion.objects.all().order_by(
def is_member(self):
last_year = Adhesion.objects.all().order_by(
'starting_in').reverse().first()
return last_adh_year and self in last_adh_year.adherent.all()
return last_year and self in last_year.members.all()
class Clef(models.Model):