* src/SelectChild.py (on_save_child_clicke): Dont add the same person multiple times as child

* src/gramps_main.py (delete_person_response): Purge empty family after the last child of a single-spouse family was deleted.


svn: r5125
This commit is contained in:
Martin Hawlisch
2005-08-25 21:05:44 +00:00
parent acedbb4417
commit 59162682c0
3 changed files with 32 additions and 3 deletions

View File

@@ -206,7 +206,15 @@ class SelectChild:
else:
self.family.set_mother_handle(self.person.get_handle())
self.db.commit_family(self.family,trans)
# check that selected child is not already a child in family
if handle in self.family.get_child_handle_list():
ErrorDialog(_("Error selecting a child"),
_("The person is already linked as child"),
self.top)
return
# check that selected child is not already a spouse in family
if handle in (self.family.get_father_handle(),self.family.get_mother_handle()):
ErrorDialog(_("Error selecting a child"),
_("A person cannot be linked as his/her own child"),