Commit 66986320 authored by Jérome Perrin's avatar Jérome Perrin Committed by Aurel

deferred_style: minor style changes

parent 97135d13
from Products.PythonScripts.standard import newline_to_br, html_quote
portal = context.getPortalObject() portal = context.getPortalObject()
prefs = portal.portal_preferences prefs = portal.portal_preferences
report_item_list = [] report_item_list = []
from Products.PythonScripts.standard import newline_to_br, html_quote
message_text_format = "text/plain" message_text_format = "text/plain"
if prefs.getPreferredDeferredReportStoredAsDocument(): if prefs.getPreferredDeferredReportStoredAsDocument():
...@@ -11,12 +11,10 @@ if prefs.getPreferredDeferredReportStoredAsDocument(): ...@@ -11,12 +11,10 @@ if prefs.getPreferredDeferredReportStoredAsDocument():
publication_section=prefs.getPreferredDeferredReportPublicationSection(), publication_section=prefs.getPreferredDeferredReportPublicationSection(),
classification=prefs.getPreferredDeferredReportClassification(), classification=prefs.getPreferredDeferredReportClassification(),
filename=attachment['name'], filename=attachment['name'],
#title=attachment['name'],
) )
document.share() document.share()
report_item_list.append( report_item_list.append(
(attachment.get('title', document.getStandardFilename(format=format)), #attachment['name']), (attachment.get('title', document.getStandardFilename(format=format)), document.getRelativeUrl()))
document.getRelativeUrl()))
url_base = portal.ERP5Site_getAbsoluteUrl() url_base = portal.ERP5Site_getAbsoluteUrl()
report_url_text = '<br/>'.join([ report_url_text = '<br/>'.join([
...@@ -29,19 +27,18 @@ if prefs.getPreferredDeferredReportStoredAsDocument(): ...@@ -29,19 +27,18 @@ if prefs.getPreferredDeferredReportStoredAsDocument():
notification_message = portal.portal_notifications.getDocumentValue(reference=notification_message_reference) notification_message = portal.portal_notifications.getDocumentValue(reference=notification_message_reference)
if notification_message is None: if notification_message is None:
raise ValueError('Notification message not found by %r' % prefs.getPreferredDeferredReportNotificationMessageReference()) raise ValueError('Notification message not found by %r' % prefs.getPreferredDeferredReportNotificationMessageReference())
notification_mapping_dict={ notification_mapping_dict = {
'report_link_list': report_url_text, 'report_link_list': report_url_text,
} }
if notification_message.getContentType() == "text/html": if notification_message.getContentType() == "text/html":
message = notification_message.asEntireHTML( message = notification_message.asEntireHTML(
safe_substitute=False, safe_substitute=False,
substitution_method_parameter_dict={'mapping_dict':notification_mapping_dict}) substitution_method_parameter_dict={'mapping_dict': notification_mapping_dict})
else: else:
message_text_format = "text/plain" message_text_format = "text/plain"
message = notification_message.asText( message = notification_message.asText(
safe_substitute=False, safe_substitute=False,
substitution_method_parameter_dict={'mapping_dict':notification_mapping_dict}) substitution_method_parameter_dict={'mapping_dict': notification_mapping_dict})
portal.portal_notifications.activate(activity='SQLQueue').sendMessage( portal.portal_notifications.activate(activity='SQLQueue').sendMessage(
recipient=user_name, recipient=user_name,
......
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