Dead people are shown as alive

Fixes #6364.
This commit is contained in:
SNoiraud 2017-06-02 12:22:15 +02:00 committed by Nick Hall
parent d486052378
commit 65b058ff75

View File

@ -108,11 +108,7 @@ class ProbablyAlive:
if death_ref: if death_ref:
death = self.db.get_event_from_handle(death_ref.ref) death = self.db.get_event_from_handle(death_ref.ref)
if death: if death:
if death.get_date_object().is_valid():
death_date = death.get_date_object() death_date = death.get_date_object()
else: # has a death event, but it is not valid:
death_date = Today() # before today
death_date.set_modifier(Date.MOD_BEFORE)
# Look for Cause Of Death, Burial or Cremation events. # Look for Cause Of Death, Burial or Cremation events.
# These are fairly good indications that someone's not alive. # These are fairly good indications that someone's not alive.
@ -144,6 +140,7 @@ class ProbablyAlive:
if not birth_date and death_date: if not birth_date and death_date:
# person died more than MAX after current year # person died more than MAX after current year
if death_date.is_valid():
birth_date = death_date.copy_offset_ymd(year=-self.MAX_AGE_PROB_ALIVE) birth_date = death_date.copy_offset_ymd(year=-self.MAX_AGE_PROB_ALIVE)
explain = _("death date") explain = _("death date")