From fa0ccf779a54a14ea1101241e7f4944a4f1cc74d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 26 Dec 2003 21:14:45 +0000 Subject: [PATCH] * 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 --- gramps2/src/plugins/Check.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/gramps2/src/plugins/Check.py b/gramps2/src/plugins/Check.py index 439d56aff..a4e76befa 100644 --- a/gramps2/src/plugins/Check.py +++ b/gramps2/src/plugins/Check.py @@ -214,22 +214,31 @@ class CheckIntegrity: mother = family.getMother() type = family.getRelationship() - if father == None or mother == None: + if not father and not mother: continue - if type != "Partners": - if father.getGender() == mother.getGender(): - family.setRelationship("Partners") - self.fam_rel.append(family) - elif father.getGender() == RelLib.Person.female or \ - mother.getGender() == RelLib.Person.male: + 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) - self.fam_rel.append(family) + family.setFather(None) 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") 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.setMother(father)