Commit 03136bb9 authored by Lucas Carvalho's avatar Lucas Carvalho

Check if the user is Anonymous before to proceed with the purchase.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29041 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0050fb85
...@@ -53,9 +53,20 @@ ...@@ -53,9 +53,20 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># redirect the user to the good payment form\n <value> <string># check if the user is Anonymous, if yes it must be redirected to Registration Dialog\n
# otherwise it will redirect to the appropriated payment form based on Payment Mode selected\n
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
\n \n
if isAnon:\n
# create first an account for user\n
msg = translateString("You need to create an account to continue. If you already have please login.")\n
context.Base_redirect(\'WebSite_viewRegistrationDialog\', \\\n
keep_items={\'editable_mode\': 0,\n
\'portal_status_message\': msg})\n
return\n
\n
if field_my_payment_mode is None:\n if field_my_payment_mode is None:\n
msg = translateString("You must select a payment mode.")\n msg = translateString("You must select a payment mode.")\n
else:\n else:\n
...@@ -82,6 +93,12 @@ return\n ...@@ -82,6 +93,12 @@ return\n
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>field_my_payment_mode=None, **kw</string> </value> <value> <string>field_my_payment_mode=None, **kw</string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
<value> <value>
...@@ -110,9 +127,11 @@ return\n ...@@ -110,9 +127,11 @@ return\n
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>request</string>
<string>isAnon</string>
<string>translateString</string> <string>translateString</string>
<string>None</string>
<string>msg</string> <string>msg</string>
<string>None</string>
<string>dict</string> <string>dict</string>
</tuple> </tuple>
</value> </value>
......
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