* src/GrampsDb/_DbUtils.py (remove_parent_from_family): If removing family, also remove it from the child's parent_family_list.
svn: r6314
This commit is contained in:
parent
2fea3361e5
commit
c12e25d0ae
@ -1,4 +1,7 @@
|
|||||||
2006-04-11 Alex Roitman <shura@gramps-project.org>
|
2006-04-11 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/GrampsDb/_DbUtils.py (remove_parent_from_family): If
|
||||||
|
removing family, also remove it from the child's
|
||||||
|
parent_family_list.
|
||||||
* src/ViewManager.py (ViewManager.change_page): Always toggle the
|
* src/ViewManager.py (ViewManager.change_page): Always toggle the
|
||||||
sidebar buttons, even if no data is loaded.
|
sidebar buttons, even if no data is loaded.
|
||||||
|
|
||||||
|
@ -69,9 +69,14 @@ def remove_parent_from_family(db, person_handle, family_handle, trans=None):
|
|||||||
elif family.get_mother_handle() == person_handle:
|
elif family.get_mother_handle() == person_handle:
|
||||||
family.set_mother_handle(None)
|
family.set_mother_handle(None)
|
||||||
|
|
||||||
|
child_list = family.get_child_handle_list()
|
||||||
if (not family.get_father_handle() and not family.get_mother_handle() and
|
if (not family.get_father_handle() and not family.get_mother_handle() and
|
||||||
len(family.get_child_handle_list()) <= 1):
|
len(child_list) <= 1):
|
||||||
db.remove_family(family_handle, trans)
|
db.remove_family(family_handle, trans)
|
||||||
|
if child_list:
|
||||||
|
child = db.get_person_from_handle(child_list[0])
|
||||||
|
child.remove_parent_family_handle(family_handle)
|
||||||
|
db.commit_person(child, trans)
|
||||||
msg = _("Remove father from family")
|
msg = _("Remove father from family")
|
||||||
else:
|
else:
|
||||||
db.commit_family(family, trans)
|
db.commit_family(family, trans)
|
||||||
|
Loading…
Reference in New Issue
Block a user