2006-05-26 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: build skip list for SelectFamily so that * a person cannot be his own parent * src/Editors/_EditFamily.py: don't allow a person to be his own parent * src/Selectors/_BaseSelector.py: Add skipping of handles * src/DisplayModels/_BaseModel.py: Add skipping of handles * src/DisplayModels/_MediaModel.py: Add skipping of handles * src/DisplayModels/_RepositoryModel.py: Add skipping of handles * src/DisplayModels/_SourceModel.py: Add skipping of handles * src/DisplayModels/_EventModel.py: Add skipping of handles * src/DisplayModels/_FamilyModel.py: Add skipping of handles * src/DisplayModels/_PlaceModel.py: Add skipping of handles svn: r6790
This commit is contained in:
@@ -734,6 +734,32 @@ class EditFamily(EditPrimary):
|
||||
else:
|
||||
original = None
|
||||
|
||||
# do some basic checks
|
||||
|
||||
child_list = [ ref.ref for ref in self.obj.get_child_ref_list() ]
|
||||
|
||||
if self.obj.get_father_handle() in child_list:
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
father = db.get_person_from_handle(self.obj.get_father_handle())
|
||||
name = "%s [%s]" % (NameDisplay.displayer.display(father),
|
||||
father.gramps_id)
|
||||
ErrorDialog(_("A father cannot be his own child"),
|
||||
_("%s is listed as both the father and child of "
|
||||
"of the family.") % name)
|
||||
return
|
||||
elif self.obj.get_mother_handle() in child_list:
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
mother = db.get_person_from_handle(self.obj.get_mother_handle())
|
||||
name = "%s [%s]" % (NameDisplay.displayer.display(mother),
|
||||
mother.gramps_id)
|
||||
ErrorDialog(_("A mother cannot be her own child"),
|
||||
_("%s is listed as both the mother and child of "
|
||||
"of the family.") % name)
|
||||
return
|
||||
|
||||
|
||||
if not original and not self.object_is_empty():
|
||||
trans = self.db.transaction_begin()
|
||||
|
||||
|
Reference in New Issue
Block a user