* src/SelectChild.py (on_save_child_clicked): Corrections.
svn: r3096
This commit is contained in:
parent
c518c0fd66
commit
cd5e0d9a37
@ -1,3 +1,6 @@
|
|||||||
|
2004-04-21 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
|
* src/SelectChild.py (on_save_child_clicked): Corrections.
|
||||||
|
|
||||||
2004-04-20 Alex Roitman <shura@alex.neuro.umn.edu>
|
2004-04-20 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/ChooseParents.py: Disallow selecting self as a parent.
|
* src/ChooseParents.py: Disallow selecting self as a parent.
|
||||||
|
|
||||||
|
@ -277,6 +277,12 @@ class SelectChild:
|
|||||||
|
|
||||||
id = idlist[0]
|
id = idlist[0]
|
||||||
select_child = self.db.get_person(id)
|
select_child = self.db.get_person(id)
|
||||||
|
if self.person.get_id() == id:
|
||||||
|
ErrorDialog(_("Error selecting a child"),
|
||||||
|
_("A person cannot be linked as his/her own child"),
|
||||||
|
self.top)
|
||||||
|
return
|
||||||
|
|
||||||
if self.family == None:
|
if self.family == None:
|
||||||
self.family = self.db.new_family()
|
self.family = self.db.new_family()
|
||||||
self.person.add_family_id(self.family.get_id())
|
self.person.add_family_id(self.family.get_id())
|
||||||
@ -285,8 +291,14 @@ class SelectChild:
|
|||||||
else:
|
else:
|
||||||
self.family.set_mother_id(self.person)
|
self.family.set_mother_id(self.person)
|
||||||
|
|
||||||
|
if id in (self.family.get_father_id(),self.family.get_mother_id()):
|
||||||
|
ErrorDialog(_("Error selecting a child"),
|
||||||
|
_("A person cannot be linked as his/her own child"),
|
||||||
|
self.top)
|
||||||
|
return
|
||||||
|
|
||||||
self.family.add_child_id(select_child.get_id())
|
self.family.add_child_id(select_child.get_id())
|
||||||
|
|
||||||
mrel = const.child_relations.find_value(self.mrel.get_text())
|
mrel = const.child_relations.find_value(self.mrel.get_text())
|
||||||
mother = self.db.find_person_from_id(self.family.get_mother_id())
|
mother = self.db.find_person_from_id(self.family.get_mother_id())
|
||||||
if mother and mother.get_gender() != RelLib.Person.female:
|
if mother and mother.get_gender() != RelLib.Person.female:
|
||||||
@ -301,12 +313,6 @@ class SelectChild:
|
|||||||
|
|
||||||
select_child.add_parent_family_id(self.family.get_id(),mrel,frel)
|
select_child.add_parent_family_id(self.family.get_id(),mrel,frel)
|
||||||
|
|
||||||
if id in (self.family.get_father_id(),self.family.get_mother_id()):
|
|
||||||
ErrorDialog(_("Error selecting a child"),
|
|
||||||
_("A person cannot be linked as his/her own child"),
|
|
||||||
self.top)
|
|
||||||
return
|
|
||||||
|
|
||||||
trans = self.db.start_transaction()
|
trans = self.db.start_transaction()
|
||||||
self.db.commit_person(select_child,trans)
|
self.db.commit_person(select_child,trans)
|
||||||
self.db.add_transaction(trans)
|
self.db.add_transaction(trans)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user