Commit 9a36f52f authored by Jérome Perrin's avatar Jérome Perrin

base: update code relying on incorrect default value of person.getTitle

parent 48bc52d3
...@@ -8,11 +8,11 @@ sender = event.getSourceValue() ...@@ -8,11 +8,11 @@ sender = event.getSourceValue()
if kw.get("from_url") is not None: if kw.get("from_url") is not None:
from_url = kw.get("from_url") from_url = kw.get("from_url")
elif sender is not None: elif sender is not None:
from_url = formataddr((sender.getTitle(), sender.getDefaultEmailText())) from_url = formataddr((sender.hasTitle() and sender.getTitle(), sender.getDefaultEmailText()))
else: else:
from_url = portal.portal_preferences.getPreferredEventSenderEmail() from_url = portal.portal_preferences.getPreferredEventSenderEmail()
to_url = formataddr((context.getTitle(), context.getDefaultEmailText())) to_url = formataddr((context.hasTitle() and context.getTitle(), context.getDefaultEmailText()))
document_type_list = list(event.getPortalEmbeddedDocumentTypeList()) + list(event.getPortalDocumentTypeList()) document_type_list = list(event.getPortalEmbeddedDocumentTypeList()) + list(event.getPortalDocumentTypeList())
embedded_file_list = event.getAggregateValueList(portal_type=document_type_list) embedded_file_list = event.getAggregateValueList(portal_type=document_type_list)
......
...@@ -35,7 +35,7 @@ if to_url is None: ...@@ -35,7 +35,7 @@ if to_url is None:
for recipient in context.getDestinationValueList(): for recipient in context.getDestinationValueList():
email = recipient.getDefaultEmailText() email = recipient.getDefaultEmailText()
if email: if email:
to_url_list.append(formataddr((recipient.getTitle(), recipient.getDefaultEmailText()))) to_url_list.append(formataddr((recipient.hasTitle() and recipient.getTitle(), recipient.getDefaultEmailText())))
else: else:
# MailMessage portal type is supposed to have a constraint to report this # MailMessage portal type is supposed to have a constraint to report this
# to the user earlier # to the user earlier
...@@ -55,7 +55,7 @@ if download or not use_activity: ...@@ -55,7 +55,7 @@ if download or not use_activity:
if from_url is None: if from_url is None:
sender = context.getSourceValue() sender = context.getSourceValue()
if sender is not None: if sender is not None:
from_url = formataddr((sender.getTitle(), sender.getDefaultEmailText())) from_url = formataddr((sender.hasTitle() and sender.getTitle(), sender.getDefaultEmailText()))
else: else:
from_url = portal.portal_preferences.getPreferredEventSenderEmail() from_url = portal.portal_preferences.getPreferredEventSenderEmail()
if not from_url: if not from_url:
......
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