2006-09-12 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: provide a waring if a broken family is detected * src/plugins/Check.py: Don't remove families with no parents unless no children exist svn: r7321
This commit is contained in:
@ -514,24 +514,10 @@ class CheckIntegrity:
|
||||
father_handle = family.get_father_handle()
|
||||
mother_handle = family.get_mother_handle()
|
||||
|
||||
if not father_handle and not mother_handle:
|
||||
if not father_handle and not mother_handle and \
|
||||
len(family.get_child_ref_list()) == 0:
|
||||
self.empty_family.append(family_id)
|
||||
self.delete_empty_family(family_handle)
|
||||
continue
|
||||
elif not father_handle and len(family.get_child_ref_list()) == 0:
|
||||
person = self.db.get_person_from_handle(mother_handle)
|
||||
person.remove_family_handle(family_handle)
|
||||
self.db.commit_person(person,self.trans)
|
||||
self.db.remove_family(family_handle,self.trans)
|
||||
self.empty_family.append(family_id)
|
||||
continue
|
||||
elif not mother_handle and len(family.get_child_ref_list()) == 0:
|
||||
person = self.db.get_person_from_handle(father_handle)
|
||||
person.remove_family_handle(family_handle)
|
||||
self.db.commit_person(person,self.trans)
|
||||
self.db.remove_family(family_handle,self.trans)
|
||||
self.empty_family.append(family_id)
|
||||
continue
|
||||
|
||||
def delete_empty_family(self,family_handle):
|
||||
for key in self.db.get_person_handles(sort_handles=False):
|
||||
|
Reference in New Issue
Block a user