6067: Narrative Web reports people as Living even when they have a deceased event (but without a date because it is unknown)

svn: r21008
This commit is contained in:
Doug Blank 2013-01-06 02:31:28 +00:00
parent 9b1ab12514
commit 98958cb164

View File

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