From c689bcc39f4e83e58474550cce52f31e3da4b5c2 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 27 Nov 2006 02:55:40 +0000 Subject: [PATCH] * src/plugins/Check.py (check_for_broken_family_links): Check if child is one of the parents. svn: r7714 --- gramps2/ChangeLog | 2 ++ gramps2/src/plugins/Check.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b8c285478..09c199f54 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -3,6 +3,8 @@ * po/gramps.pot: updated 2006-11-26 Alex Roitman + * src/plugins/Check.py (check_for_broken_family_links): Check if + child is one of the parents. * src/GrampsDb/_GrampsBSDDB.py (load): Clean env for a new grdb file; do not attempt recovery for a new grdb file. * NEWS: Typo. diff --git a/gramps2/src/plugins/Check.py b/gramps2/src/plugins/Check.py index 1efd11edd..c545773d7 100644 --- a/gramps2/src/plugins/Check.py +++ b/gramps2/src/plugins/Check.py @@ -354,6 +354,13 @@ class CheckIntegrity: child_handle = child_ref.ref child = self.db.get_person_from_handle(child_handle) if child: + if child_handle in [father_handle,mother_handle]: + # The child is one of the parents: impossible + # Remove such child from the family + family.remove_child_ref(child_ref) + self.db.commit_family(family,self.trans) + self.broken_links.append((child_handle,family_handle)) + continue if family_handle == child.get_main_parents_family_handle(): continue if family_handle not in \