bug fix for age calculation with missing birth date
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2439 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
85d2423663
commit
fc6660a457
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ class Person(object):
|
||||||
return self.ageAt(date.today())
|
return self.ageAt(date.today())
|
||||||
|
|
||||||
def ageAt(self, date):
|
def ageAt(self, date):
|
||||||
if self.birthDate is None:
|
if not self.birthDate:
|
||||||
return None
|
return None
|
||||||
return int((date - self.birthDate).days/365.25)
|
return int((date - self.birthDate).days/365.25)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue