* 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
|
||||||
|
elif father == None:
|
||||||
|
if mother.getGender() == RelLib.Person.male:
|
||||||
|
family.setFather(mother)
|
||||||
|
family.setMother(None)
|
||||||
|
elif mother == None:
|
||||||
|
if father.getGender() == RelLib.Person.female:
|
||||||
|
family.setMother(father)
|
||||||
|
family.setFather(None)
|
||||||
|
else:
|
||||||
|
fgender = father.getGender()
|
||||||
|
mgender = mother.getGender()
|
||||||
if type != "Partners":
|
if type != "Partners":
|
||||||
if father.getGender() == mother.getGender():
|
if fgender == mgender and fgender != RelLib.Person.unknown:
|
||||||
family.setRelationship("Partners")
|
family.setRelationship("Partners")
|
||||||
self.fam_rel.append(family)
|
self.fam_rel.append(family)
|
||||||
elif father.getGender() == RelLib.Person.female or \
|
elif fgender == RelLib.Person.female or mgender == RelLib.Person.male:
|
||||||
mother.getGender() == RelLib.Person.male:
|
|
||||||
family.setFather(mother)
|
family.setFather(mother)
|
||||||
family.setMother(father)
|
family.setMother(father)
|
||||||
self.fam_rel.append(family)
|
self.fam_rel.append(family)
|
||||||
else:
|
elif fgender != mgender:
|
||||||
if father.getGender() != mother.getGender():
|
|
||||||
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