9517: [In "Verify" people w/ death event w/o date are not thought dead]
This commit is contained in:
parent
c5133aed04
commit
6890fc4324
@ -173,6 +173,19 @@ def get_birth_date(db, person, estimate=False):
|
|||||||
ret = 0 if ret is None else ret
|
ret = 0 if ret is None else ret
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def get_death(db, person):
|
||||||
|
"""
|
||||||
|
boolean whether there is a death event or not
|
||||||
|
(if a user claims a person is dead, we will believe it even with no date)
|
||||||
|
"""
|
||||||
|
if not person:
|
||||||
|
return False
|
||||||
|
death_ref = person.get_death_ref()
|
||||||
|
if death_ref:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def get_death_date(db, person, estimate=False):
|
def get_death_date(db, person, estimate=False):
|
||||||
if not person:
|
if not person:
|
||||||
return 0
|
return 0
|
||||||
@ -1578,8 +1591,9 @@ class OldAgeButNoDeath(PersonRule):
|
|||||||
|
|
||||||
def broken(self):
|
def broken(self):
|
||||||
birth_date = get_birth_date(self.db,self.obj,self.est)
|
birth_date = get_birth_date(self.db,self.obj,self.est)
|
||||||
dead = get_death_date(self.db,self.obj,True) # if no death use burial
|
dead = get_death(self.db, self.obj)
|
||||||
if dead or not birth_date:
|
death_date = get_death_date(self.db, self.obj, True) # use burial ...
|
||||||
|
if dead or death_date or not birth_date:
|
||||||
return 0
|
return 0
|
||||||
age = ( _today - birth_date ) / 365
|
age = ( _today - birth_date ) / 365
|
||||||
return ( age > self.old_age )
|
return ( age > self.old_age )
|
||||||
|
Loading…
Reference in New Issue
Block a user