* src/Check.py: repair family types of "None" in the database

svn: r4332
This commit is contained in:
Don Allingham 2005-04-10 21:21:58 +00:00
parent 7a2634c8fa
commit 9ed9f57c21
2 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,5 @@
2005-04-10 Don Allingham <don@gramps-project.org>
* src/Check.py: repair family types of "None" in the database
* src/Makefile.am: add MergePeople.py
2005-04-09 Don Allingham <don@gramps-project.org>

View File

@ -157,6 +157,10 @@ class CheckIntegrity:
person = self.db.get_person_from_handle(person_handle)
for family_type in person.get_parent_family_handle_list():
family = self.db.get_family_from_handle(family_type[0])
if not family:
person.remove_parent_family_handle(family_type[0])
self.db.commit_person(person,self.trans)
continue
for child_handle in family.get_child_handle_list():
if child_handle == person_handle:
break
@ -413,8 +417,11 @@ class CheckIntegrity:
cn = person.get_primary_name().get_name()
else:
cn = _("Non existing child")
try:
family = self.db.get_family_from_handle(family_handle)
pn = Utils.family_name(family,self.db)
except:
pn = _("Unknown")
self.text.write('\t')
self.text.write(_("%s was removed from the family of %s\n") % (cn,pn))