8621: Recursion Filter error
This commit is contained in:
parent
abf785be5e
commit
2f0496d0a3
@ -78,16 +78,20 @@ class IsDescendantFamilyOf(Rule):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Add self
|
# Add self
|
||||||
self.matches.add(person.handle)
|
expand = [person]
|
||||||
|
|
||||||
|
while expand:
|
||||||
|
person = expand.pop(0)
|
||||||
|
if person is None:
|
||||||
|
continue
|
||||||
|
self.matches.add(person.handle)
|
||||||
for family_handle in person.get_family_handle_list():
|
for family_handle in person.get_family_handle_list():
|
||||||
family = self.db.get_family_from_handle(family_handle)
|
family = self.db.get_family_from_handle(family_handle)
|
||||||
if family:
|
if family:
|
||||||
# Add every child recursively
|
# Add every child recursively
|
||||||
for child_ref in family.get_child_ref_list():
|
for child_ref in family.get_child_ref_list():
|
||||||
if child_ref:
|
if child_ref:
|
||||||
self.add_matches(self.db.get_person_from_handle(child_ref.ref))
|
expand.append(self.db.get_person_from_handle(child_ref.ref))
|
||||||
|
|
||||||
# Add spouse
|
# Add spouse
|
||||||
if person.handle == family.get_father_handle():
|
if person.handle == family.get_father_handle():
|
||||||
spouse_handle = family.get_mother_handle()
|
spouse_handle = family.get_mother_handle()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user