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):