* src/ChooseParents.py: fix unbound variable when neither parents

exist.


svn: r5213
This commit is contained in:
Don Allingham 2005-09-21 19:09:26 +00:00
parent e1ae9c619e
commit 693879e004
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,6 @@
2005-09-21 Don Allingham <don@gramps-project.org> 2005-09-21 Don Allingham <don@gramps-project.org>
* src/ChooseParents.py: fix unbound variable when neither parents
exist.
* src/plugins/DetAncestralReport.py: fix endnotes for null sources * src/plugins/DetAncestralReport.py: fix endnotes for null sources
* src/plugins/DetDescendantReport.py: fix endnotes for null sources * src/plugins/DetDescendantReport.py: fix endnotes for null sources
* src/plugins/FtmStyleAncestors.py: fix endnotes for null sources * src/plugins/FtmStyleAncestors.py: fix endnotes for null sources

View File

@ -525,25 +525,23 @@ class ChooseParents:
father_rel = RelLib.Person.CHILD_REL_BIRTH father_rel = RelLib.Person.CHILD_REL_BIRTH
trans = self.db.transaction_begin() trans = self.db.transaction_begin()
father_handle = None
mother_handle = None
if self.father or self.mother: if self.father or self.mother:
if self.mother and not self.father: if self.mother and not self.father:
if self.mother.get_gender() == RelLib.Person.MALE: if self.mother.get_gender() == RelLib.Person.MALE:
self.father = self.mother self.father = self.mother
father_handle = self.father.get_handle() father_handle = self.father.get_handle()
self.mother = None self.mother = None
mother_handle = None
else: else:
mother_handle = self.mother.get_handle() mother_handle = self.mother.get_handle()
father_handle = None
elif self.father and not self.mother: elif self.father and not self.mother:
if self.father.get_gender() == RelLib.Person.FEMALE: if self.father.get_gender() == RelLib.Person.FEMALE:
self.mother = self.father self.mother = self.father
self.father = None self.father = None
mother_handle = self.mother.get_handle() mother_handle = self.mother.get_handle()
father_handle = None
else: else:
father_handle = self.father.get_handle() father_handle = self.father.get_handle()
mother_handle = None
elif self.mother.get_gender() != self.father.get_gender(): elif self.mother.get_gender() != self.father.get_gender():
if self.type == "Partners": if self.type == "Partners":
self.type = "Unknown" self.type = "Unknown"