Commit e204aa3c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Update Workflow

parent 6c147857
Pipeline #18495 failed with stage
in 0 seconds
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</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>state_change</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Project_generateInvitation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from zExceptions import Unauthorized
project = state_change['object']
portal = person.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
if person is None:
raise Unauthorized
for assignment in person.objectValues(portal_type="Assignment"):
if assignment.getDestinationProject() == context.getRelativeUrl():
assignment.close()
break
......@@ -60,7 +60,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Project_requestToken</string> </value>
<value> <string>script_Project_leaveProject</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......
......@@ -18,7 +18,7 @@
<tuple>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_accept_invitation</string>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_approve_registration</string>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_request_token</string>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_leave_project</string>
</tuple>
</value>
</item>
......
......@@ -24,7 +24,7 @@
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/project_slap_interface_workflow/script_Project_checkConsistency</string>
<string>after_script/portal_workflow/project_slap_interface_workflow/script_Project_requestToken</string>
<string>after_script/portal_workflow/project_slap_interface_workflow/script_Project_approveRegistration</string>
</tuple>
</value>
</item>
......
......@@ -24,7 +24,7 @@
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/project_slap_interface_workflow/script_Project_checkConsistency</string>
<string>after_script/portal_workflow/project_slap_interface_workflow/script_Project_requestToken</string>
<string>after_script/portal_workflow/project_slap_interface_workflow/script_Project_leaveProject</string>
</tuple>
</value>
</item>
......@@ -48,7 +48,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_request_token</string> </value>
<value> <string>transition_leave_project</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -56,7 +56,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RequestToken</string> </value>
<value> <string>Leave Project</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
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