diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.py b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.py deleted file mode 100644 index d4a6b53344f049b91a497e8401b66c92c9638fd7..0000000000000000000000000000000000000000 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.py +++ /dev/null @@ -1,9 +0,0 @@ -kwargs = state_change['kwargs'] -person = state_change['object'] - -if not person.hasUserId(): - person.edit(user_id=kwargs['reference']) -person.newContent( - portal_type='ERP5 Login', - password=kwargs['password'], - reference=kwargs['reference']).validate() diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.xml deleted file mode 100644 index 142063b5e33f3d99d391df823cbfda70c39f8647..0000000000000000000000000000000000000000 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - Script_magic - 3 - - - _bind_names - - - - - - - - - - _asgns - - - - name_container - container - - - name_context - context - - - name_m_self - script - - - name_subpath - traverse_subpath - - - - - - - - - - - _params - state_change - - - _proxy_roles - - - Manager - - - - - id - UserAccountWorkflow_createUser - - - - - diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.py b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.py deleted file mode 100644 index ce4522caa648379e7995a20c8bdbe2c86dad3e8d..0000000000000000000000000000000000000000 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.py +++ /dev/null @@ -1,12 +0,0 @@ -from Products.DCWorkflow.DCWorkflow import ValidationFailed -from Products.ERP5Type.Message import translateString - -kwargs = state_change['kwargs'] -password = kwargs['password'] -password_confirm = kwargs['password_confirm'] -if password != password_confirm: - raise ValidationFailed(translateString('Passwords do not match.')) - -reference = kwargs['reference'] -if not reference: - raise ValidationFailed(translateString('User Login is not specified.')) diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.xml deleted file mode 100644 index bc231afc081485e77f7ef2e8ed6aa1cc01d7dbd7..0000000000000000000000000000000000000000 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - Script_magic - 3 - - - _bind_names - - - - - - - - - - _asgns - - - - name_container - container - - - name_context - context - - - name_m_self - script - - - name_subpath - traverse_subpath - - - - - - - - - - - _params - state_change - - - id - UserAccountWorkflow_verifyUserCreationInput - - - - - diff --git a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/transitions/create_user_action.xml b/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/transitions/create_user_action.xml deleted file mode 100644 index 0dcbdc2aae3c659d0e08ea5c3124b80e660317b7..0000000000000000000000000000000000000000 --- a/bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/transitions/create_user_action.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - actbox_category - workflow - - - actbox_name - Create User - - - actbox_url - %(content_url)s/Person_viewCreateUserActionDialog?workflow_action=create_user_action - - - after_script_name - UserAccountWorkflow_createUser - - - description - Action called on a person to create his login/password - - - guard - - AAAAAAAAAAI= - - - - id - create_user_action - - - new_state_id - - - - script_name - UserAccountWorkflow_verifyUserCreationInput - - - title - Create User Action - - - trigger_type - 1 - - - - - - - - - - - - roles - - - Assignor - Assignee - Manager - - - - - - - diff --git a/product/ERP5/tests/testERP5Base.py b/product/ERP5/tests/testERP5Base.py index 8e6a6516f6200b1c4578e642a2d9300b7954029a..bad736173414544a1e4f76ed5fa6fde71da0d25d 100644 --- a/product/ERP5/tests/testERP5Base.py +++ b/product/ERP5/tests/testERP5Base.py @@ -1160,10 +1160,12 @@ class TestERP5Base(ERP5TypeTestCase): group='nexedi/storever') self.assertNotEquals(None, assignment.getGroupValue()) assignment.open() - self.portal.portal_workflow.doActionFor(person, 'create_user_action', - reference='user_login', - password='pass', - password_confirm='pass') + login = person.newContent( + portal_type="ERP5 Login", + reference="user_login", + password="pass", + ) + login.validate() self.tic() # a user is created