Commit 04fa3aa1 authored by Ivan Tyagov's avatar Ivan Tyagov

Use directly portal_notifications tool.

Return result of redirect call as it's used
in testERP5Credential.
parent 13426916
...@@ -52,11 +52,7 @@ ...@@ -52,11 +52,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Send an email after accept a credential request\n Send an email after accept a credential request\n
Proxy: Assignee, Assignor, Member -- allow to send notification by mail\n Proxy: Assignee, Assignor, Member -- allow to send notification by mail.\n
\n
Example of notification message:\n
Congratulation, the creation of you new Instance Name account \'${login_name}\' is finished.\\nYour password is \'${login_password}\'\\nThank you"))\n
Congratulation, the creation of you new Instance Name account \'${user_id}\' is finished.\\n\\nThank you",\n
"""\n """\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
...@@ -70,7 +66,8 @@ if password:\n ...@@ -70,7 +66,8 @@ if password:\n
\n \n
#Get message from catalog\n #Get message from catalog\n
notification_reference = \'crendential_request-confirmation-%s\' % notification_type\n notification_reference = \'crendential_request-confirmation-%s\' % notification_type\n
notification_message = context.NotificationTool_getDocumentValue(reference=notification_reference, language=recipient.getLanguage())\n notification_message = portal.portal_notifications.getDocumentValue(reference=notification_reference, \n
language=recipient.getLanguage())\n
if notification_message is None:\n if notification_message is None:\n
raise ValueError, \'Unable to found Notification Message with reference "%s".\' % notification_reference\n raise ValueError, \'Unable to found Notification Message with reference "%s".\' % notification_reference\n
\n \n
......
...@@ -100,7 +100,7 @@ else:\n ...@@ -100,7 +100,7 @@ else:\n
\'reference\': reference}\n \'reference\': reference}\n
\n \n
keep_items[\'portal_status_message\'] = portal.Base_translateString(message)\n keep_items[\'portal_status_message\'] = portal.Base_translateString(message)\n
portal.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n return portal.Base_redirect(form_id=\'login_form\', keep_items=keep_items)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -121,7 +121,7 @@ else:\n ...@@ -121,7 +121,7 @@ else:\n
message_str = "Credential Request Created."\n message_str = "Credential Request Created."\n
\n \n
\n \n
portal.Base_redirect(form_id=\'login_form\', \n return portal.Base_redirect(form_id=\'login_form\', \n
keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -92,7 +92,7 @@ else:\n ...@@ -92,7 +92,7 @@ else:\n
\n \n
portal_status_message = context.Base_translateString("Credential Update Created.")\n portal_status_message = context.Base_translateString("Credential Update Created.")\n
\n \n
portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n return portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_message})\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
382 383
\ 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