Commit f1df95b7 authored by Sebastien Robin's avatar Sebastien Robin

Revert "use prefered_sender_section for credential related messages if exist."

This reverts commit 43b1531d.

=> It introduce testERP5Credential regressions
parent 28cdbbf9
...@@ -73,13 +73,8 @@ if context.hasStopDate():\n ...@@ -73,13 +73,8 @@ if context.hasStopDate():\n
else:\n else:\n
kw = {}\n kw = {}\n
\n \n
sender = portal.portal_preferences.getPreferredSenderSection()\n
if sender is not None:\n
sender = portal.restrictedTraverse(sender)\n
\n
portal.portal_password.mailPasswordResetRequest(user_login=reference,\n portal.portal_password.mailPasswordResetRequest(user_login=reference,\n
REQUEST=context.REQUEST,\n REQUEST=context.REQUEST,\n
sender=sender,\n
notification_message=notification_message,\n notification_message=notification_message,\n
store_as_event=portal.portal_preferences.isPreferredStoreEvents(),\n store_as_event=portal.portal_preferences.isPreferredStoreEvents(),\n
**kw)\n **kw)\n
......
...@@ -63,11 +63,8 @@ for person in person_list:\n ...@@ -63,11 +63,8 @@ for person in person_list:\n
usernames = " ".join(usernames)\n usernames = " ".join(usernames)\n
\n \n
reference_list = [x.getReference() for x in person_list]\n reference_list = [x.getReference() for x in person_list]\n
if context.hasDocumentReference():\n message_reference = portal.portal_preferences.getPreferredCredentialUsernameRecoveryMessageReference()\n
message_reference = context.getDocumentReference()\n if message_reference is None:\n
else:\n
message_reference = portal.portal_preferences.getPreferredCredentialUsernameRecoveryMessageReference()\n
if message_reference is None:\n
raise ValueError, "Preference not configured"\n raise ValueError, "Preference not configured"\n
\n \n
notification_message = portal.NotificationTool_getDocumentValue(message_reference,\n notification_message = portal.NotificationTool_getDocumentValue(message_reference,\n
...@@ -83,12 +80,7 @@ else:\n ...@@ -83,12 +80,7 @@ else:\n
\n \n
subject = notification_message.asSubjectText(substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n subject = notification_message.asSubjectText(substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n \n
sender = portal.portal_preferences.getPreferredSenderSection()\n
if sender is not None:\n
sender = portal.restrictedTraverse(sender)\n
\n
portal.portal_notifications.sendMessage(\n portal.portal_notifications.sendMessage(\n
sender=sender,\n
recipient=person_list,\n recipient=person_list,\n
subject=subject,\n subject=subject,\n
message=mail_text,\n message=mail_text,\n
......
...@@ -85,12 +85,8 @@ else:\n ...@@ -85,12 +85,8 @@ else:\n
substitution_method_parameter_dict={\'mapping_dict\':notification_mapping_dict})\n substitution_method_parameter_dict={\'mapping_dict\':notification_mapping_dict})\n
\n \n
#Send email\n #Send email\n
sender = portal.portal_preferences.getPreferredSenderSection()\n
if sender is not None:\n
sender = portal.restrictedTraverse(sender)\n
\n
portal.portal_notifications.sendMessage(\n portal.portal_notifications.sendMessage(\n
sender=sender,\n sender=None,\n
recipient=recipient,\n recipient=recipient,\n
subject=notification_message.getTitle(),\n subject=notification_message.getTitle(),\n
message=mail_text,\n message=mail_text,\n
......
...@@ -60,10 +60,9 @@ Member -- Use mailhost service\n ...@@ -60,10 +60,9 @@ Member -- Use mailhost service\n
"""\n """\n
\n \n
from random import randint\n from random import randint\n
portal = context.getPortalObject()\n
\n \n
#Get message\n #Get message\n
notification_message = portal.portal_catalog.getResultValue(portal_type="Notification Message",\n notification_message = context.portal_catalog.getResultValue(portal_type="Notification Message",\n
reference=notification_reference)\n reference=notification_reference)\n
notification_message_reference = randint(0, 999**9)\n notification_message_reference = randint(0, 999**9)\n
\n \n
...@@ -80,12 +79,7 @@ else:\n ...@@ -80,12 +79,7 @@ else:\n
mail_text = notification_message.asText(\n mail_text = notification_message.asText(\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n \n
sender = portal.portal_preferences.getPreferredSenderSection()\n context.portal_notifications.sendMessage(\n
if sender is not None:\n
sender = portal.restrictedTraverse(sender)\n
\n
portal.portal_notifications.sendMessage(\n
sender=sender,\n
recipient=(context,),\n recipient=(context,),\n
subject=notification_message.getTitle(),\n subject=notification_message.getTitle(),\n
message=mail_text,\n message=mail_text,\n
......
2012-05-01 Kazuhiko
* use prefered_sender_section for credential related messages if exist.
2012-04-27 Kazuhiko 2012-04-27 Kazuhiko
* use document_reference in Credential Recovery as the reference of nofitication message if exists. * use document_reference in Credential Recovery as the reference of nofitication message if exists.
......
416 415
\ No newline at end of file \ No newline at end of file
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