diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1e1648d8a..f83d8d3bf 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,8 @@ 2005-03-29 Alex Roitman * src/Witness.py (WitnessEditor.__init__): Work around missing reference. + * src/gramps_main.py (delete_person_response): Object/handle mixups, + remove unneeded commits. 2005-03-29 Richard Taylor * src/plugins/ScratchPad.py (on_object_select_row): fixed the drop of diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 57854eb5e..d171ddf09 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -1388,26 +1388,26 @@ class Gramps: if not family_handle: continue family = self.db.get_family_from_handle(family_handle) + family_to_remove = False if self.active_person.get_handle() == family.get_father_handle(): - if family.get_mother_handle() == None: - for child_handle in family.get_child_handle_list(): - child = self.db.get_person_from_handle(child_handle) - child.remove_parent_family_handle(family.get_handle()) - self.db.commit_person(child,trans) - self.db.remove_family(family.get_handle(),trans) - else: + if family.get_mother_handle(): family.set_father_handle(None) - else: - if family.get_father_handle() == None: - for child_handle in family.get_child_handle_list(): - child = self.db.get_person_from_handle(child_handle) - child.remove_parent_family_handle(family) - self.db.commit_person(child,trans) - self.db.remove_family(family,trans) else: + family_to_remove = True + else: + if family.get_father_handle(): family.set_mother_handle(None) - self.db.commit_family(family,trans) - + else: + family_to_remove = True + if family_to_remove: + for child_handle in family.get_child_handle_list(): + child = self.db.get_person_from_handle(child_handle) + child.remove_parent_family_handle(family_handle) + self.db.commit_person(child,trans) + self.db.remove_family(family_handle,trans) + else: + self.db.commit_family(family,trans) + for (family_handle,mrel,frel) in self.active_person.get_parent_family_handle_list(): if family_handle: family = self.db.get_family_from_handle(family_handle)