Commit d9ab3412 authored by Ivan Tyagov's avatar Ivan Tyagov

Allow to specify group on Credential Request.

Create (and open Assingmnet) before validating Person object.
parent a2bbaeae
......@@ -156,6 +156,7 @@
<string>my_dialog_mode_required_default_email_text</string>
<string>my_dialog_mode_date_of_birth</string>
<string>my_view_mode_date_of_birth</string>
<string>my_view_mode_group_list</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>description</string>
<string>items</string>
<string>size</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_group_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string>The groups of the person in the organisation.</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_category_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Groups</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: getattr(context.portal_categories.group, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=\'translated_title\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,16 +75,16 @@ context.CredentialRequest_setDefaultDestinationDecision([x for x in related_port
# Check consistency of the subscription, pass a copy of the dict\n
context.Credential_checkConsistency([x for x in related_portal_type])\n
\n
# Fill related object with credential request\n
for portal_type in related_portal_type:\n
getattr(context,\'CredentialRequest_setRegisteredInformationTo%s\' % portal_type.replace(\' \',\'\'))()\n
\n
# Create assignment\n
context.CredentialRequest_updatePersonAssignment()\n
\n
# Create account\n
login, password = context.CredentialRequest_createUser()\n
\n
# Fill related object with credential request\n
for portal_type in related_portal_type:\n
getattr(context,\'CredentialRequest_setRegisteredInformationTo%s\' % portal_type.replace(\' \',\'\'))()\n
\n
# Update Local Roles\n
context.CredentialRequest_updateLocalRolesOnSecurityGroups()\n
\n
......
......@@ -105,6 +105,7 @@ for role in context.getRoleList():\n
site = context.getSite(),\n
activity = context.getActivityList(),\n
function = context.getFunctionList(),\n
group = context.getGroupList(),\n
destination = organisation_url,\n
start_date = today,\n
stop_date = delay)\n
......@@ -116,6 +117,14 @@ for role in context.getRoleList():\n
<key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CredentialRequest_updatePersonAssignment</string> </value>
......
......@@ -140,8 +140,9 @@
<string>my_default_credential_question_question</string>
<string>my_default_credential_question_question_free_text</string>
<string>my_default_credential_question_answer</string>
<string>my_role_list</string>
<string>my_group_list</string>
<string>my_function</string>
<string>my_role_list</string>
<string>my_site</string>
<string>my_translated_validation_state_title</string>
</list>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_group_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_group_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCredentialFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
385
\ No newline at end of file
386
\ 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