From 06cb9d7ea661df82871ef74df6f75ffa3fff197b Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Thu, 9 Jan 2020 19:09:25 +0100 Subject: [PATCH] Narweb: Private notes for home, intro and contact (#953) If the notes are private, we can't use them in these pages. --- gramps/plugins/webreport/contact.py | 7 ++++--- gramps/plugins/webreport/home.py | 12 +++++++----- gramps/plugins/webreport/introduction.py | 12 +++++++----- gramps/plugins/webreport/narrativeweb.py | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/gramps/plugins/webreport/contact.py b/gramps/plugins/webreport/contact.py index 1ed62004d..1c27cf1e4 100644 --- a/gramps/plugins/webreport/contact.py +++ b/gramps/plugins/webreport/contact.py @@ -126,10 +126,11 @@ class ContactPage(BasePage): note_id = report.options['contactnote'] if note_id: note = self.r_db.get_note_from_gramps_id(note_id) - note_text = self.get_note_format(note, False) + if note: + note_text = self.get_note_format(note, False) - # attach note - summaryarea += note_text + # attach note + summaryarea += note_text # add clearline for proper styling # add footer section diff --git a/gramps/plugins/webreport/home.py b/gramps/plugins/webreport/home.py index 69cffb7ba..0606d867b 100644 --- a/gramps/plugins/webreport/home.py +++ b/gramps/plugins/webreport/home.py @@ -87,15 +87,17 @@ class HomePage(BasePage): section += homeimg note_id = report.options['homenote'] + ldatec = None if note_id: note = self.r_db.get_note_from_gramps_id(note_id) - note_text = self.get_note_format(note, False) + if note: + note_text = self.get_note_format(note, False) - # attach note - section += note_text + # attach note + section += note_text - # last modification of this note - ldatec = note.get_change_time() + # last modification of this note + ldatec = note.get_change_time() # create clear line for proper styling # create footer section diff --git a/gramps/plugins/webreport/introduction.py b/gramps/plugins/webreport/introduction.py index 73020ee03..193924099 100644 --- a/gramps/plugins/webreport/introduction.py +++ b/gramps/plugins/webreport/introduction.py @@ -87,15 +87,17 @@ class IntroductionPage(BasePage): section += introimg note_id = report.options['intronote'] + ldatec = None if note_id: note = self.r_db.get_note_from_gramps_id(note_id) - note_text = self.get_note_format(note, False) + if note: + note_text = self.get_note_format(note, False) - # attach note - section += note_text + # attach note + section += note_text - # last modification of this note - ldatec = note.get_change_time() + # last modification of this note + ldatec = note.get_change_time() # add clearline for proper styling # create footer section diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index 648a0a395..cd4df8588 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -1453,7 +1453,7 @@ class NavWebReport(Report): output_file.close() else: output_file.close() - if date > 0: + if date is not None and date > 0: os.utime(output_file.name, (date, date)) def prepare_copy_media(self, photo):