From 9ecc6656256eb2a4ef15285adde221957be65a66 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 22 Jan 2014 16:11:07 +0000 Subject: [PATCH] 5123: Fix bug in associations filter --- gramps/gen/filters/rules/person/_hasassociation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gramps/gen/filters/rules/person/_hasassociation.py b/gramps/gen/filters/rules/person/_hasassociation.py index 9e427663a..c40999f70 100755 --- a/gramps/gen/filters/rules/person/_hasassociation.py +++ b/gramps/gen/filters/rules/person/_hasassociation.py @@ -61,13 +61,13 @@ class HasAssociation(Rule): else: self.count_type = 1 # "equal to" - self.userSelectedCount = int(self.list[0]) + self.selected_count = int(self.list[0]) def apply(self, db, person): - return len( person.get_person_ref_list()) > 0 + count = len(person.get_person_ref_list()) if self.count_type == 0: # "lesser than" - return count < self.userSelectedCount + return count < self.selected_count elif self.count_type == 2: # "greater than" - return count > self.userSelectedCount + return count > self.selected_count # "equal to" - return count == self.userSelectedCount + return count == self.selected_count