Commit 80549c7a authored by Sli's avatar Sli
Browse files

Fixed get_age

parent e1ce661a
Pipeline #187 failed with stage
in 1 minute and 50 seconds
......@@ -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):
"""
......
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