Commit 57abdb64 authored by Ivan Tyagov's avatar Ivan Tyagov

Finish user registration.

parent a298d0b6
from Products.ERP5Type.Message import translateString
portal = context.getPortalObject()
assert key
mail_message = portal.portal_catalog.getResultValue(portal_type="Mail Message", reference=key)
credential_request = mail_message.getFollowUpValue()
if credential_request.getValidationState() in ('submitted', 'accepted'):
message = translateString("Your account is already active.")
else:
credential_request.submit(comment=translateString('Created by subscription form'))
mail_message.deliver()
message = translateString("Your account is being activated. You will receive an e-mail when activation is complete.")
if not batch_mode:
return portal.Base_redirect("login_form", keep_items=dict(portal_status_message=message))
else:
return message
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>key, batch_mode=1</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_activeLogin</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -17,7 +17,7 @@ if not context.CredentialRequest_checkLoginAvailability(reference):
else:
return json.dumps({'msg': message_str,
'code':1})
credential_request = module.newContent(
portal_type="Credential Request",
first_name=first_name,
......
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