From d0a83dd39c7ed5d08d0ce3ee278ef73cf89e1199 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 21 Jan 2015 17:32:31 +0000 Subject: [PATCH] 7299: Fix bug when family has no parents --- gramps/plugins/textreport/placereport.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/gramps/plugins/textreport/placereport.py b/gramps/plugins/textreport/placereport.py index 4721b5bac..79e69d9fb 100644 --- a/gramps/plugins/textreport/placereport.py +++ b/gramps/plugins/textreport/placereport.py @@ -282,11 +282,6 @@ class PlaceReport(Report): person = self.database.get_person_from_handle(ref_handle) nameEntry = "%s (%s)" % (self._nd.display(person), person.get_gramps_id()) - if nameEntry in person_dict: - person_dict[nameEntry].append(evt_handle) - else: - person_dict[nameEntry] = [] - person_dict[nameEntry].append(evt_handle) else: family = self.database.get_family_from_handle(ref_handle) f_handle = family.get_father_handle() @@ -300,7 +295,7 @@ class PlaceReport(Report): 'father_id' : father.get_gramps_id(), 'mother' : self._nd.display(mother), 'mother_id' : mother.get_gramps_id()} - else: + elif f_handle or m_handle: if f_handle: p_handle = f_handle else: @@ -310,12 +305,15 @@ class PlaceReport(Report): nameEntry = "%s (%s)" % \ (self._nd.display(person), person.get_gramps_id()) - - if nameEntry in person_dict: - person_dict[nameEntry].append(evt_handle) else: - person_dict[nameEntry] = [] - person_dict[nameEntry].append(evt_handle) + # No parents - bug #7299 + continue + + if nameEntry in person_dict: + person_dict[nameEntry].append(evt_handle) + else: + person_dict[nameEntry] = [] + person_dict[nameEntry].append(evt_handle) keys = list(person_dict.keys()) keys.sort() @@ -329,6 +327,10 @@ class PlaceReport(Report): date = self._get_date(event.get_date_object()) descr = event.get_description() event_type = self._(self._get_type(event.get_type())) + else: + date = '' + descr = '' + event_type = '' event_details = [people, event_type, descr, date] self.doc.start_row() for detail in event_details: