From 2bbc8702a7ddab85093580556a820dd050f86dd4 Mon Sep 17 00:00:00 2001 From: prculley Date: Tue, 25 Oct 2016 10:39:51 -0500 Subject: [PATCH] bug 9522; fix fault when viewing family events with event gramplet --- gramps/plugins/gramplet/events.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/gramplet/events.py b/gramps/plugins/gramplet/events.py index df34183ec..72400ea10 100644 --- a/gramps/plugins/gramplet/events.py +++ b/gramps/plugins/gramplet/events.py @@ -179,7 +179,6 @@ class PersonEvents(Events): Return True if the gramplet has data, else return False. """ if active_person: - self.cached_start_date = self.get_start_date() if active_person.get_event_ref_list(): return True for family_handle in active_person.get_family_handle_list(): @@ -187,8 +186,6 @@ class PersonEvents(Events): if family: for event_ref in family.get_event_ref_list(): return True - else: - self.cached_start_date = None return False def main(self): # return false finishes @@ -207,11 +204,14 @@ class PersonEvents(Events): """ active_person = self.dbstate.db.get_person_from_handle(active_handle) if active_person: + self.cached_start_date = self.get_start_date() for event_ref in active_person.get_event_ref_list(): self.add_event_ref(event_ref) for family_handle in active_person.get_family_handle_list(): family = self.dbstate.db.get_family_from_handle(family_handle) self.display_family(family, active_person) + else: + self.cached_start_date = None self.set_has_data(self.model.count > 0) def display_family(self, family, active_person): @@ -276,6 +276,7 @@ class FamilyEvents(Events): Display the events for the active family. """ active_family = self.dbstate.db.get_family_from_handle(active_handle) + self.cached_start_date = self.get_start_date() for event_ref in active_family.get_event_ref_list(): self.add_event_ref(event_ref) self.set_has_data(self.model.count > 0)