mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 18:44:23 +00:00
commit
4503fae287
@ -305,7 +305,9 @@ class User(AbstractBaseUser):
|
||||
"""
|
||||
Returns the age
|
||||
"""
|
||||
return timezone.now().year - self.date_of_birth.year
|
||||
today = timezone.now()
|
||||
born = self.date_of_birth
|
||||
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
|
||||
|
||||
def email_user(self, subject, message, from_email=None, **kwargs):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user