From e4e56b4a0c1c5bb189d60eee41cf9b956d98d6c6 Mon Sep 17 00:00:00 2001 From: Tristan Cavelier Date: Fri, 2 Mar 2018 08:50:24 -0500 Subject: [PATCH] erp5_base: drop create_user_action ERP5 does not handle user "account" anymore, it handles "login". Please use "Add ERP5 Login" or any other login you need instead. --- .../scripts/UserAccountWorkflow_createUser.py | 9 --- .../UserAccountWorkflow_createUser.xml | 70 ----------------- ...AccountWorkflow_verifyUserCreationInput.py | 12 --- ...ccountWorkflow_verifyUserCreationInput.xml | 62 --------------- .../transitions/create_user_action.xml | 77 ------------------- product/ERP5/tests/testERP5Base.py | 10 ++- 6 files changed, 6 insertions(+), 234 deletions(-) delete mode 100644 bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.py delete mode 100644 bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_createUser.xml delete mode 100644 bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.py delete mode 100644 bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/scripts/UserAccountWorkflow_verifyUserCreationInput.xml delete mode 100644 bt5/erp5_base/WorkflowTemplateItem/portal_workflow/user_account_workflow/transitions/create_user_action.xml 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 d4a6b53344f..00000000000 --- 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 142063b5e33..00000000000 --- 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 ce4522caa64..00000000000 --- 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 bc231afc081..00000000000 --- 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 0dcbdc2aae3..00000000000 --- 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 8e6a6516f62..bad73617341 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 -- 2.30.9