Commit 38bef5f9 by Bryton Lacquement

erp5_corporate_identity: support unobtainable creation dates (= None)

1 parent 672ad477
......@@ -56,8 +56,8 @@ leaflet_title = leaflet.getTitle()
leaflet_relative_url = leaflet.getRelativeUrl()
leaflet_language = leaflet.getLanguage()
leaflet_creation_date = leaflet.getCreationDate()
leaflet_date = leaflet_creation_date.strftime('%Y-%b')
leaflet_year = leaflet_creation_date.strftime('%Y')
leaflet_date = leaflet_creation_date.strftime('%Y-%b') if leaflet_creation_date else blank
leaflet_year = leaflet_creation_date.strftime('%Y') if leaflet_creation_date else blank
leaflet_reference = leaflet.getReference()
leaflet_version = leaflet.getVersion() or "001"
leaflet_aggregate_list = []
......
......@@ -60,7 +60,7 @@ release_creation_date = release.getCreationDate()
release_modification_date = release.getModificationDate()
release_aggregate_list = []
release_relative_url = release.getRelativeUrl()
release_creation_year = release_creation_date.strftime('%Y')
release_creation_year = release_creation_date.strftime('%Y') if release_creation_date else blank
#release_creation_month = release_creation_date.strftime('%b')
#release_date = ''.join([release_creation_month, "-", release_creation_year])
release_reference = release.getReference()
......
......@@ -201,7 +201,8 @@ doc_content = removeEmptyDetails(doc_dirty_content)
doc_title = doc.getShortTitle() or doc.getTitle()
doc_language = doc.getLanguage()
doc_description = doc.getDescription()
doc_creation_year = doc.getCreationDate().strftime('%Y')
doc_creation_date = doc.getCreationDate()
doc_creation_year = doc_creation_date.strftime('%Y') if doc_creation_date else blank
doc_version = doc.getVersion() or "001"
doc_reference = doc.getReference()
doc_relative_url = doc.getRelativeUrl()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!