From 11858a624d3f2969f28361db5f60dbd3de6e28a2 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Wed, 14 Dec 2011 19:43:24 +0000 Subject: [PATCH] Remove Event and Family media on Individual Pages if the Event and Family pages are already being created. svn: r18599 --- src/plugins/webreport/NarrativeWeb.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 4ea093277..02fe24704 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -4888,16 +4888,25 @@ class IndividualPage(BasePage): photo_list = self.person.get_media_list() media_list = photo_list[:] - for handle in self.person.get_family_handle_list(): - family = db.get_family_from_handle(handle) - media_list += family.get_media_list() - for evt_ref in family.get_event_ref_list(): + + # if Family Pages are not being created, then include the Family Media objects? + # there is no reason to add these objects to the Individual Pages... + if not self.inc_families: + for handle in self.person.get_family_handle_list(): + family = db.get_family_from_handle(handle) + if family: + media_list += family.get_media_list() + for evt_ref in family.get_event_ref_list(): + event = db.get_event_from_handle(evt_ref.ref) + media_list += event.get_media_list() + + # if the Event Pages are not being createsd, then include the Event Media objects? + # there is no reason to add these objects to the Individual Pages... + if not self.inc_events: + for evt_ref in self.person.get_primary_event_ref_list(): event = db.get_event_from_handle(evt_ref.ref) - media_list += event.get_media_list() - for evt_ref in self.person.get_primary_event_ref_list(): - event = db.get_event_from_handle(evt_ref.ref) - if event: - media_list += event.get_media_list() + if event: + media_list += event.get_media_list() # display additional images as gallery sect7 = self.display_additional_images_as_gallery(media_list, person)