From 6cbe9e31b50e8fa232aedebfd47bcd4a95569b6c Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Tue, 9 Aug 2011 20:34:21 +0000 Subject: [PATCH] 5145: attempted deletion stopped svn: r18020 --- src/gen/db/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gen/db/base.py b/src/gen/db/base.py index bb72e74bb..4564510b9 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -40,6 +40,7 @@ from gen.ggettext import gettext as _ #------------------------------------------------------------------------- import gen.lib from txn import DbTxn +from exceptions import DbTransactionCancel class DbReadBase(object): """ @@ -1693,6 +1694,11 @@ class DbWriteBase(DbReadBase): elif family.get_mother_handle() == person_handle: msg = _("Remove mother from family") family.set_mother_handle(None) + else: + raise DbTransactionCancel("The relation between the person and " + "the family you try to remove is not consistent, please fix " + "that first, for example from the family editor or by running " + "the database repair tool, before removing the family.") if (not family.get_father_handle() and not family.get_mother_handle() and not family.get_child_ref_list()):