From fc6660a457d21a65bf365033adf8e0d4b8975877 Mon Sep 17 00:00:00 2001 From: helmutm Date: Fri, 7 Mar 2008 11:27:00 +0000 Subject: [PATCH] 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 --- organize/party.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/organize/party.py b/organize/party.py index e0654f4..508aa7b 100644 --- a/organize/party.py +++ b/organize/party.py @@ -32,7 +32,7 @@ from cybertools.organize.interfaces import IPerson, IAddress class Person(object): implements(IPerson) - + def __init__(self, lastName, firstName=u'', birthDate=None): self.lastName = lastName self.firstName = firstName @@ -49,7 +49,7 @@ class Person(object): return self.ageAt(date.today()) def ageAt(self, date): - if self.birthDate is None: + if not self.birthDate: return None return int((date - self.birthDate).days/365.25)