Commit 26d395a1 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: just return empty page instead of crash if content is empty

parent f9b05107
......@@ -81,6 +81,9 @@ else:
letter_version = "001"
letter_reference = letter.getReference()
if not letter_content:
return
# overrides for tests
if override_batch_mode:
letter_modification_date = DateTime("1976-11-04")
......
......@@ -69,6 +69,8 @@ book_relative_url = book.getRelativeUrl()
book_prefix = pref.getPreferredCorporateIdentityTemplateBookDocumentPrefix() or "Book."
book_rendering_fix = book.WebPage_getPdfOutputRenderingFix() or blank
book_content = book.getTextContent()
if not book_content:
return
book_aggregate_list = []
book_revision = book.getRevision()
book_modification_date = book.getModificationDate()
......
......@@ -22,6 +22,8 @@ contract_relative_url = context.getRelativeUrl()
contract_prefix='Contract.'
contract_rendering_fix = context.WebPage_getPdfOutputRenderingFix() or blank
contract_content = context.getTextContent()
if not contract_content:
return
contract_aggregate_list = []
contract_revision = context.getRevision()
contract_modification_date = context.getModificationDate()
......
......@@ -52,6 +52,8 @@ override_batch_mode = kw.get('batch_mode')
# -------------------------- Document Parameters ------------------------------
leaflet_content = leaflet.getTextContent()
if not leaflet_content:
return
leaflet_title = leaflet.getTitle()
leaflet_relative_url = leaflet.getRelativeUrl()
leaflet_language = leaflet.getLanguage()
......
......@@ -52,6 +52,8 @@ override_batch_mode = kw.get('batch_mode')
# -------------------------- Document Parameters ------------------------------
release_content = release.getTextContent()
if not release_content:
return
release_title = release.getTitle()
release_language = release.getLanguage()
release_short_title = release.getShortTitle()
......
......@@ -172,6 +172,8 @@ doc_download = int(kw.get('document_download') or 0)
doc_save = int(kw.get('document_save') or 0)
doc_ooo = kw.get('remote_content') or None
doc_content = doc_ooo or doc.getTextContent()
if not doc_content:
return
doc_is_slideshow = getSlideList(doc_content) or None
override_logo_reference = kw.get('override_logo_reference', None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment