Commit 095baff6 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Refactor code to follow last changes in SystemPreference_viewCredential form....

Refactor code to follow last changes in SystemPreference_viewCredential form. Now all categories are returned in list and setCategoryList method is used to set all properties in assignment.
parent a3ee19c3
......@@ -51,14 +51,11 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Returns the function list and role list according to the properties \n
selected in System Preference enabled\n
Returns list with all categories defined on Credential\'s tab\n
"""\n
portal_preferences = context.getPortalObject().portal_preferences\n
function_list = portal_preferences.getPreferredCredentialAssignmentFunctionList()\n
role_list = portal_preferences.getPreferredCredentialAssignmentRoleList()\n
\n
return dict(role_list=role_list, function_list=function_list)\n
portal_preferences = context.portal_preferences\n
return portal_preferences.getPreferredSubscriptionAssignmentCategoryList()\n
</string> </value>
</item>
<item>
......
......@@ -58,11 +58,7 @@ module = context.getDefaultModule(\'Credential Request\')\n
username = reference\n
organisation_title = career_subordination_title\n
\n
assignment_dict = context.Base_getDefaultAssignmentArgumentDict()\n
if not role:\n
role = assignment_dict["role_list"]\n
if not function:\n
function = assignment_dict["function_list"]\n
category_list = context.Base_getDefaultAssignmentArgumentDict()\n
\n
document = module.newContent(portal_type=\'Credential Request\',\n
first_name=first_name,\n
......@@ -75,10 +71,10 @@ document = module.newContent(portal_type=\'Credential Request\',\n
default_address_city=default_address_city,\n
default_address_zip_code=default_address_zip_code,\n
language=language,\n
role=role,\n
function=function,\n
)\n
\n
document.setCategoryList(category_list)\n
\n
if not password in ["", None] and len(password.replace(\' \',\'\')) > 0:\n
document.setPassword(password)\n
\n
......@@ -106,7 +102,7 @@ return REQUEST.RESPONSE.redirect(redirect_url)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>first_name,last_name,reference,password,career_subordination_title,default_email_text,default_telephone_text,default_address_street_address,default_address_city,default_address_zip_code,role=None,function=None</string> </value>
<value> <string>first_name,last_name,reference,password,career_subordination_title,default_email_text,default_telephone_text,default_address_street_address,default_address_city,default_address_zip_code</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......
348
\ No newline at end of file
349
\ 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