From f294e891103640db731506a351140e9e974a6b5f Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sat, 5 Aug 2006 20:09:47 +0000 Subject: [PATCH] 2006-08-05 Alex Roitman * src/Filters/Rules/Family/_MotherHasNameOf.py (apply): Handle missing parents. * src/Filters/Rules/Family/_MotherHasIdOf.py (apply): Handle missing parents. * src/Filters/Rules/Family/_FatherHasNameOf.py (apply): Handle missing parents. * src/Filters/Rules/Family/_FatherHasIdOf.py (apply): Handle missing parents. svn: r7134 --- gramps2/ChangeLog | 10 ++++++++++ gramps2/src/Filters/Rules/Family/_FatherHasIdOf.py | 5 ++++- gramps2/src/Filters/Rules/Family/_FatherHasNameOf.py | 5 ++++- gramps2/src/Filters/Rules/Family/_MotherHasIdOf.py | 5 ++++- gramps2/src/Filters/Rules/Family/_MotherHasNameOf.py | 5 ++++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 581f53807..479a300dd 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,13 @@ +2006-08-05 Alex Roitman + * src/Filters/Rules/Family/_MotherHasNameOf.py (apply): Handle + missing parents. + * src/Filters/Rules/Family/_MotherHasIdOf.py (apply): Handle + missing parents. + * src/Filters/Rules/Family/_FatherHasNameOf.py (apply): Handle + missing parents. + * src/Filters/Rules/Family/_FatherHasIdOf.py (apply): Handle + missing parents. + 2006-08-04 Alex Roitman * src/Filters/SideBar: Add new module. * src/Filters/Rules/Event/Makefile.am (pkgdata_PYTHON): Ship new files. diff --git a/gramps2/src/Filters/Rules/Family/_FatherHasIdOf.py b/gramps2/src/Filters/Rules/Family/_FatherHasIdOf.py index 1df4b9db7..d159c3297 100644 --- a/gramps2/src/Filters/Rules/Family/_FatherHasIdOf.py +++ b/gramps2/src/Filters/Rules/Family/_FatherHasIdOf.py @@ -51,4 +51,7 @@ class FatherHasIdOf(HasGrampsId): def apply(self,db,family): father_handle = family.get_father_handle() father = db.get_person_from_handle(father_handle) - return HasGrampsId.apply(self,db,father) + if father: + return HasGrampsId.apply(self,db,father) + else: + return False diff --git a/gramps2/src/Filters/Rules/Family/_FatherHasNameOf.py b/gramps2/src/Filters/Rules/Family/_FatherHasNameOf.py index d62acdf84..95fd1a7d3 100644 --- a/gramps2/src/Filters/Rules/Family/_FatherHasNameOf.py +++ b/gramps2/src/Filters/Rules/Family/_FatherHasNameOf.py @@ -50,4 +50,7 @@ class FatherHasNameOf(HasNameOf): def apply(self,db,family): father_handle = family.get_father_handle() father = db.get_person_from_handle(father_handle) - return HasNameOf.apply(self,db,father) + if father: + return HasNameOf.apply(self,db,father) + else: + return False diff --git a/gramps2/src/Filters/Rules/Family/_MotherHasIdOf.py b/gramps2/src/Filters/Rules/Family/_MotherHasIdOf.py index 1898f616a..747137755 100644 --- a/gramps2/src/Filters/Rules/Family/_MotherHasIdOf.py +++ b/gramps2/src/Filters/Rules/Family/_MotherHasIdOf.py @@ -51,4 +51,7 @@ class MotherHasIdOf(HasGrampsId): def apply(self,db,family): mother_handle = family.get_mother_handle() mother = db.get_person_from_handle(mother_handle) - return HasGrampsId.apply(self,db,mother) + if mother: + return HasGrampsId.apply(self,db,mother) + else: + return False diff --git a/gramps2/src/Filters/Rules/Family/_MotherHasNameOf.py b/gramps2/src/Filters/Rules/Family/_MotherHasNameOf.py index d030ba5ed..0cceebe0e 100644 --- a/gramps2/src/Filters/Rules/Family/_MotherHasNameOf.py +++ b/gramps2/src/Filters/Rules/Family/_MotherHasNameOf.py @@ -50,4 +50,7 @@ class MotherHasNameOf(HasNameOf): def apply(self,db,family): mother_handle = family.get_mother_handle() mother = db.get_person_from_handle(mother_handle) - return HasNameOf.apply(self,db,mother) + if mother: + return HasNameOf.apply(self,db,mother) + else: + return False