From c469240c65e293a354a82871dd898df070fe530c Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Fri, 27 May 2016 09:13:11 -0700 Subject: [PATCH] 9450: LivingProxyDB leaves data in when back references followed --- gramps/gen/proxy/living.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gramps/gen/proxy/living.py b/gramps/gen/proxy/living.py index 5b627575a..3302c0752 100644 --- a/gramps/gen/proxy/living.py +++ b/gramps/gen/proxy/living.py @@ -336,14 +336,32 @@ class LivingProxyDb(ProxyDbBase): """ handle_itr = self.db.find_backlink_handles(handle, include_classes) for (class_name, handle) in handle_itr: - if class_name == "Person" and self.mode != self.MODE_INCLUDE_ALL: + if self.mode == self.MODE_INCLUDE_ALL: + yield (class_name, handle) + elif class_name == 'Person': ## Don't get backlinks to living people at all person = self.db.get_person_from_handle(handle) if person and not self.__is_living(person): yield (class_name, handle) + elif class_name == 'Family': + father = mother = None + family = self.db.get_family_from_handle(handle) + father_handle = family.get_father_handle() + mother_handle = family.get_mother_handle() + if father_handle: + father = self.db.get_person_from_handle(father_handle) + if mother_handle: + mother = self.db.get_person_from_handle(mother_handle) + father_not_living = father and not self.__is_living(father) + mother_not_living = mother and not self.__is_living(mother) + if ((father is None and mother is None) or # shouldn't happen + (father is None and mother_not_living) or # could + (mother is None and father_not_living) or # could + (father_not_living and mother_not_living) # could + ): + yield (class_name, handle) else: yield (class_name, handle) - return def __is_living(self, person): """