From 8418c06ae05e9718a568c1293229cc4c2aeb29ec Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 8 Mar 2010 02:59:49 +0000 Subject: [PATCH] 3673: People with less than 1 year seems to be ignored on 'Age on Date' gramplet and 'Records' report svn: r14689 --- src/Utils.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Utils.py b/src/Utils.py index 6556dd09a..5e00a2d3b 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -456,18 +456,20 @@ class ProbablyAlive(object): # If the recorded death year is before current year then # things are simple. if death_ref and death_ref.get_role().is_primary(): - death = self.db.get_event_from_handle(death_ref.ref) - if death and death.get_date_object().get_start_date() != gen.lib.Date.EMPTY: - death_date = death.get_date_object() + if death_ref: + death = self.db.get_event_from_handle(death_ref.ref) + if death and death.get_date_object().get_start_date() != gen.lib.Date.EMPTY: + death_date = death.get_date_object() # Look for Cause Of Death, Burial or Cremation events. # These are fairly good indications that someone's not alive. if not death_date: for ev_ref in person.get_primary_event_ref_list(): - ev = self.db.get_event_from_handle(ev_ref.ref) - if ev and ev.type.is_death_fallback(): - death_date = ev.get_date_object() - explain = _("death-related evidence") + if ev_ref: + ev = self.db.get_event_from_handle(ev_ref.ref) + if ev and ev.type.is_death_fallback(): + death_date = ev.get_date_object() + explain = _("death-related evidence") # If they were born within X years before current year then # assume they are alive (we already know they are not dead). @@ -838,7 +840,7 @@ def probably_alive(person, db, return False # FIXME: use match here: # if the current_date is before birth, not alive: - if (birth - current_date)[0] >= 0: + if (birth - current_date)[0] > 0: if return_range: return (False, birth, death, explain, relative) else: