Commit 4503fae2 authored by Skia's avatar Skia
Browse files

Merge branch 'sli' into 'master'

Fixed get_age



See merge request !3
parents e1ce661a 80549c7a
Pipeline #188 failed with stage
in 1 minute and 40 seconds
...@@ -305,7 +305,9 @@ class User(AbstractBaseUser): ...@@ -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):
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment