Merge branch 'sli' into 'master'

Fixed get_age



See merge request !3
This commit is contained in:
Skia 2016-09-04 16:54:30 +02:00
commit 4503fae287

View File

@ -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):
"""