From 9ed9f57c2110a48ea7b7e68590a539560008b6ce Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 10 Apr 2005 21:21:58 +0000 Subject: [PATCH] * src/Check.py: repair family types of "None" in the database svn: r4332 --- ChangeLog | 1 + src/plugins/Check.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4e7d9d81..42a82a75e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ 2005-04-10 Don Allingham + * src/Check.py: repair family types of "None" in the database * src/Makefile.am: add MergePeople.py 2005-04-09 Don Allingham diff --git a/src/plugins/Check.py b/src/plugins/Check.py index 63996839e..4572649d8 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -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") - family = self.db.get_family_from_handle(family_handle) - pn = Utils.family_name(family,self.db) + 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))