* src/ChooseParents.py (save_parents_clicked): Do not create

family if parent is self.


svn: r4970
This commit is contained in:
Alex Roitman 2005-07-27 00:58:17 +00:00
parent 2335612283
commit 52d06de491
2 changed files with 14 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2005-07-26 Alex Roitman <shura@gramps-project.org>
* src/ChooseParents.py (save_parents_clicked): Do not create
family if parent is self.
2005-07-26 Don Allingham <don@gramps-project.org>
* src/EditPerson.py: NameDisplay enhancements
* src/FamilyView.py: NameDisplay enhancements

View File

@ -555,20 +555,21 @@ class ChooseParents:
self.type = "Partners"
father_handle = self.father.get_handle()
mother_handle = self.mother.get_handle()
self.family = self.find_family(father_handle,mother_handle,trans)
else:
self.family = None
if self.family:
if self.person.get_handle() in (father_handle,mother_handle):
ErrorDialog(_("Error selecting a child"),
_("A person cannot be linked as his/her own parent"),
self.window)
return
if father_handle or mother_handle:
self.family = self.find_family(father_handle,mother_handle,trans)
self.family.add_child_handle(self.person.get_handle())
self.family.set_relationship(self.type)
self.change_family_type(self.family,mother_rel,father_rel)
self.db.commit_family(self.family,trans)
else:
self.family = None
self.db.transaction_commit(trans,_("Choose Parents"))
self.close(None)