mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 11:04:20 +00:00
Fixed get_age
This commit is contained in:
parent
e1ce661a04
commit
80549c7a33
@ -305,7 +305,9 @@ class User(AbstractBaseUser):
|
|||||||
"""
|
"""
|
||||||
Returns the age
|
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):
|
def email_user(self, subject, message, from_email=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user