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