From 15e44633cf675a03b21dc2dabc9700759f47700e Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 8 Jan 2013 03:28:20 +0000 Subject: [PATCH] 6067: Narrative Web reports people as Living even when they have a deceased event (but without a date because it is unknown) svn: r21030 --- gramps/gen/utils/alive.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gramps/gen/utils/alive.py b/gramps/gen/utils/alive.py index 11119e116..53c0c55dc 100644 --- a/gramps/gen/utils/alive.py +++ b/gramps/gen/utils/alive.py @@ -101,13 +101,16 @@ class ProbablyAlive(object): death_date = None birth_date = None explain = "" - # If the recorded death year is before current year then - # things are simple. + if death_ref and death_ref.get_role().is_primary(): if death_ref: death = self.db.get_event_from_handle(death_ref.ref) if death and death.get_date_object().get_start_date() != Date.EMPTY: death_date = death.get_date_object() + elif death: # has a death event, but it is empty: + death_date = Today() # before today + death_date.set_modifier(Date.MOD_BEFORE) + explain = _("death event without date") # Look for Cause Of Death, Burial or Cremation events. # These are fairly good indications that someone's not alive. @@ -117,7 +120,12 @@ class ProbablyAlive(object): 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 death_date.get_start_date() != Date.EMPTY: + explain = _("death-related evidence") + else: + death_date = Today() # before today + death_date.set_modifier(Date.MOD_BEFORE) + explain = _("death-related evidence without date") # If they were born within X years before current year then # assume they are alive (we already know they are not dead). @@ -495,7 +503,7 @@ def probably_alive(person, db, death += limit # add these years to death # Finally, check to see if current_date is between dates result = (current_date.match(birth, ">=") and - current_date.match(death, "<=")) + current_date.match(death, "<<")) if return_range: return (result, birth, death, explain, relative) else: