Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
91117882
Commit
91117882
authored
Sep 01, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: drop person.requestOrganisation
parent
75c02e1d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
192 deletions
+46
-192
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation.py
...p_interface_workflow/script_Person_requestOrganisation.py
+0
-45
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation.xml
..._interface_workflow/script_Person_requestOrganisation.xml
+0
-76
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestSite.py
...rson_slap_interface_workflow/script_Person_requestSite.py
+46
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/state_draft.xml
...l_workflow/person_slap_interface_workflow/state_draft.xml
+0
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/state_open_order_created.xml
...rson_slap_interface_workflow/state_open_order_created.xml
+0
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/transition_request_organisation.xml
...ap_interface_workflow/transition_request_organisation.xml
+0
-68
No files found.
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation.py
deleted
100644 → 0
View file @
75c02e1d
person
=
state_change
[
'object'
]
portal
=
person
.
getPortalObject
()
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
organisation_title
=
kwargs
[
'organisation_title'
]
except
KeyError
:
raise
TypeError
,
"Person_requestOrganisation takes exactly 1 argument"
role_id
=
context
.
REQUEST
.
get
(
"role_id"
,
"client"
)
tag
=
"%s_%s_%s_OrganisationInProgress"
%
(
person
.
getUid
(),
role_id
,
organisation_title
)
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
# The software instance is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
raise
NotImplementedError
(
tag
)
organisation_portal_type
=
"Organisation"
if
role_id
not
in
[
"client"
,
"host"
]:
raise
NotImplementedError
organisation_list
=
[
i
for
i
in
portal
.
portal_catalog
.
portal_catalog
(
portal_type
=
organisation_portal_type
,
title
=
organisation_title
,
limit
=
2
)
if
i
.
getRole
()
==
role_id
]
if
len
(
organisation_list
)
==
2
:
raise
NotImplementedError
elif
len
(
organisation_list
)
==
1
:
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation_list
[
0
].
getRelativeUrl
())
else
:
module
=
portal
.
getDefaultModule
(
portal_type
=
organisation_portal_type
)
organisation
=
module
.
newContent
(
portal_type
=
organisation_portal_type
,
title
=
organisation_title
,
role
=
role_id
,
activate_kw
=
{
'tag'
:
tag
}
)
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation
.
getRelativeUrl
())
organisation
.
approveRegistration
()
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation.xml
deleted
100644 → 0
View file @
75c02e1d
<?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>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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_Person_requestOrganisation
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Person_requestOrganisation
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestSite.py
View file @
91117882
context
.
REQUEST
.
set
(
"role_id"
,
"host"
)
context
.
Person_requestOrganisation
(
state_change
)
person
=
state_change
[
'object'
]
portal
=
person
.
getPortalObject
()
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
organisation_title
=
kwargs
[
'organisation_title'
]
except
KeyError
:
raise
TypeError
,
"Person_requestOrganisation takes exactly 1 argument"
role_id
=
context
.
REQUEST
.
get
(
"role_id"
,
"client"
)
tag
=
"%s_%s_%s_OrganisationInProgress"
%
(
person
.
getUid
(),
role_id
,
organisation_title
)
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
# The software instance is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
raise
NotImplementedError
(
tag
)
organisation_portal_type
=
"Organisation"
if
role_id
not
in
[
"client"
,
"host"
]:
raise
NotImplementedError
organisation_list
=
[
i
for
i
in
portal
.
portal_catalog
.
portal_catalog
(
portal_type
=
organisation_portal_type
,
title
=
organisation_title
,
limit
=
2
)
if
i
.
getRole
()
==
role_id
]
if
len
(
organisation_list
)
==
2
:
raise
NotImplementedError
elif
len
(
organisation_list
)
==
1
:
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation_list
[
0
].
getRelativeUrl
())
else
:
module
=
portal
.
getDefaultModule
(
portal_type
=
organisation_portal_type
)
organisation
=
module
.
newContent
(
portal_type
=
organisation_portal_type
,
title
=
organisation_title
,
role
=
role_id
,
activate_kw
=
{
'tag'
:
tag
}
)
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation
.
getRelativeUrl
())
organisation
.
approveRegistration
()
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/state_draft.xml
View file @
91117882
...
...
@@ -19,7 +19,6 @@
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_notify
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_compute_node
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_network
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_organisation
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_project
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_site
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_software_instance
</string>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/state_open_order_created.xml
View file @
91117882
...
...
@@ -20,7 +20,6 @@
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_notify
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_compute_node
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_network
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_organisation
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_project
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_site
</string>
<string>
destination/portal_workflow/person_slap_interface_workflow/transition_request_software_instance
</string>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/transition_request_organisation.xml
deleted
100644 → 0
View file @
75c02e1d
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/person_slap_interface_workflow/script_Person_checkConsistency
</string>
<string>
after_script/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_request_organisation
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Request Organisation
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment