4284: again, fix for parentless family

svn: r17174
This commit is contained in:
Michiel Nauta 2011-04-21 04:56:02 +00:00
parent 90c0f43c9d
commit f668c23cf2

View File

@ -72,15 +72,19 @@ class HasCommonAncestorWith(Rule):
return return
for fam_handle in person.get_parent_family_handle_list(): for fam_handle in person.get_parent_family_handle_list():
parentless_fam = True
fam = db.get_family_from_handle(fam_handle) fam = db.get_family_from_handle(fam_handle)
if fam: if fam:
for par_handle in (fam.get_father_handle(), fam.get_mother_handle()): for par_handle in (fam.get_father_handle(), fam.get_mother_handle()):
if par_handle: if par_handle:
parentless_fam = False
par = db.get_person_from_handle(par_handle) par = db.get_person_from_handle(par_handle)
if par and par.handle not in self.ancestor_cache: if par and par.handle not in self.ancestor_cache:
self.add_ancs(db, par) self.add_ancs(db, par)
if par: if par:
self.ancestor_cache[person.handle] |= self.ancestor_cache[par.handle] self.ancestor_cache[person.handle] |= self.ancestor_cache[par.handle]
if parentless_fam:
self.ancestor_cache[person.handle].add(fam_handle)
def reset(self): def reset(self):
self.ancestor_cache = {} self.ancestor_cache = {}