* src/plugins/Check.py (CheckIntegrity.check_parent_relationships):
More complete checks handling unknown genders * src/PeopleView.py: Check for null iters before removing from the tree store. svn: r2555
This commit is contained in:
parent
d2cec36c25
commit
fa0ccf779a
@ -214,22 +214,31 @@ class CheckIntegrity:
|
|||||||
mother = family.getMother()
|
mother = family.getMother()
|
||||||
type = family.getRelationship()
|
type = family.getRelationship()
|
||||||
|
|
||||||
if father == None or mother == None:
|
if not father and not mother:
|
||||||
continue
|
continue
|
||||||
if type != "Partners":
|
elif father == None:
|
||||||
if father.getGender() == mother.getGender():
|
if mother.getGender() == RelLib.Person.male:
|
||||||
family.setRelationship("Partners")
|
|
||||||
self.fam_rel.append(family)
|
|
||||||
elif father.getGender() == RelLib.Person.female or \
|
|
||||||
mother.getGender() == RelLib.Person.male:
|
|
||||||
family.setFather(mother)
|
family.setFather(mother)
|
||||||
|
family.setMother(None)
|
||||||
|
elif mother == None:
|
||||||
|
if father.getGender() == RelLib.Person.female:
|
||||||
family.setMother(father)
|
family.setMother(father)
|
||||||
self.fam_rel.append(family)
|
family.setFather(None)
|
||||||
else:
|
else:
|
||||||
if father.getGender() != mother.getGender():
|
fgender = father.getGender()
|
||||||
|
mgender = mother.getGender()
|
||||||
|
if type != "Partners":
|
||||||
|
if fgender == mgender and fgender != RelLib.Person.unknown:
|
||||||
|
family.setRelationship("Partners")
|
||||||
|
self.fam_rel.append(family)
|
||||||
|
elif fgender == RelLib.Person.female or mgender == RelLib.Person.male:
|
||||||
|
family.setFather(mother)
|
||||||
|
family.setMother(father)
|
||||||
|
self.fam_rel.append(family)
|
||||||
|
elif fgender != mgender:
|
||||||
family.setRelationship("Unknown")
|
family.setRelationship("Unknown")
|
||||||
self.fam_rel.append(family)
|
self.fam_rel.append(family)
|
||||||
if father.getGender() == RelLib.Person.female:
|
if fgender == RelLib.Person.female or mgender == RelLib.Person.male:
|
||||||
family.setFather(mother)
|
family.setFather(mother)
|
||||||
family.setMother(father)
|
family.setMother(father)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user