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:
@ -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):
|
||||
|
Reference in New Issue
Block a user