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
8fc00603
Commit
8fc00603
authored
Dec 27, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Add additional tests for person_slap_interface_workflow
parent
ffdb9a87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
493 additions
and
8 deletions
+493
-8
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
...s/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
+488
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation.py
...p_interface_workflow/script_Person_requestOrganisation.py
+5
-7
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
View file @
8fc00603
...
@@ -765,4 +765,491 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
...
@@ -765,4 +765,491 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
self
.
tic
()
self
.
tic
()
self
.
assertRaises
(
NotImplementedError
,
person
.
requestComputeNode
,
self
.
assertRaises
(
NotImplementedError
,
person
.
requestComputeNode
,
compute_node_title
=
compute_node_title
)
compute_node_title
=
compute_node_title
)
\ No newline at end of file
class
TestSlapOSCorePersonRequestProject
(
SlapOSTestCaseMixin
):
def
generateNewProjectTitle
(
self
):
return
'My Project %s'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestProject_title_is_mandatoty
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestProject
)
def
test_Person_requestProject
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
project_title
=
self
.
generateNewProjectTitle
()
person
.
requestProject
(
project_title
=
project_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertNotEqual
(
None
,
project_relative_url
)
self
.
assertNotEqual
(
None
,
project_reference
)
project
=
person
.
restrictedTraverse
(
project_relative_url
)
self
.
assertEqual
(
project
.
getTitle
(),
project_title
)
self
.
assertEqual
(
project
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
project
.
getDestinationDecision
(),
person
.
getRelativeUrl
())
def
test_Person_requestProject_duplicated
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
project_title
=
self
.
generateNewProjectTitle
()
person
.
requestProject
(
project_title
=
project_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertNotEqual
(
None
,
project_relative_url
)
self
.
assertNotEqual
(
None
,
project_reference
)
project
=
person
.
restrictedTraverse
(
project_relative_url
)
self
.
assertEqual
(
project
.
getTitle
(),
project_title
)
self
.
assertEqual
(
project
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
project
.
getDestinationDecision
(),
person
.
getRelativeUrl
())
project2
=
project
.
Base_createCloneDocument
(
batch_mode
=
1
)
project2
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertRaises
(
NotImplementedError
,
person
.
requestProject
,
project_title
=
project_title
)
def
test_Person_requestProject_request_again
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
project_title
=
self
.
generateNewProjectTitle
()
person
.
requestProject
(
project_title
=
project_title
)
# check what is returned via request
project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertNotEqual
(
None
,
project_relative_url
)
self
.
assertNotEqual
(
None
,
project_reference
)
self
.
tic
()
self
.
login
()
# check what is returned via request
person
.
REQUEST
.
set
(
'project_relative_url'
,
None
)
person
.
REQUEST
.
set
(
'project_reference'
,
None
)
self
.
login
(
person
.
getUserId
())
person
.
requestProject
(
project_title
=
project_title
)
# check what is returned via request
same_project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
same_project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertEqual
(
same_project_relative_url
,
project_relative_url
)
self
.
assertEqual
(
same_project_reference
,
project_reference
)
class
TestSlapOSCorePersonRequestOrganisation
(
SlapOSTestCaseMixin
):
def
generateNewOrganisationTitle
(
self
):
return
'My Organisation %s'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestOrganisation_title_is_mandatoty
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestOrganisation
)
def
test_Person_requestOrganisation
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"client"
)
self
.
assertIn
(
"O-"
,
organisation
.
getReference
())
def
test_Person_requestOrganisation_duplicated
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"client"
)
self
.
assertIn
(
"O-"
,
organisation
.
getReference
())
organisation2
=
organisation
.
Base_createCloneDocument
(
batch_mode
=
1
)
organisation2
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertRaises
(
NotImplementedError
,
person
.
requestOrganisation
,
organisation_title
=
organisation_title
)
def
test_Person_requestOrganisation_request_again
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
self
.
tic
()
self
.
login
()
# check what is returned via request
person
.
REQUEST
.
set
(
'organisation_relative_url'
,
None
)
self
.
login
(
person
.
getUserId
())
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
# check what is returned via request
same_organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertEqual
(
same_organisation_relative_url
,
organisation_relative_url
)
def
test_Person_requestOrganisation_dont_conflict_with_site
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"client"
)
self
.
assertIn
(
"O-"
,
organisation
.
getReference
())
organisation2
=
organisation
.
Base_createCloneDocument
(
batch_mode
=
1
)
organisation2
.
edit
(
role
=
"host"
)
organisation2
.
validate
()
person
.
REQUEST
.
set
(
'organisation_relative_url'
,
None
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
person
.
requestOrganisation
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
same_organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertEqual
(
same_organisation_relative_url
,
organisation_relative_url
)
class
TestSlapOSCorePersonRequestSite
(
SlapOSTestCaseMixin
):
def
generateNewOrganisationTitle
(
self
):
return
'My Site %s'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestSite_title_is_mandatoty
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestSite
)
def
test_Person_requestSite
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestSite
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"host"
)
self
.
assertIn
(
"SITE-"
,
organisation
.
getReference
())
def
test_Person_requestSite_duplicated
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestSite
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"host"
)
self
.
assertIn
(
"SITE-"
,
organisation
.
getReference
())
organisation2
=
organisation
.
Base_createCloneDocument
(
batch_mode
=
1
)
organisation2
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertRaises
(
NotImplementedError
,
person
.
requestSite
,
organisation_title
=
organisation_title
)
def
test_Person_requestSite_request_again
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestSite
(
organisation_title
=
organisation_title
)
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
self
.
tic
()
self
.
login
()
# check what is returned via request
person
.
REQUEST
.
set
(
'organisation_relative_url'
,
None
)
self
.
login
(
person
.
getUserId
())
person
.
requestSite
(
organisation_title
=
organisation_title
)
# check what is returned via request
same_organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertEqual
(
same_organisation_relative_url
,
organisation_relative_url
)
def
test_Person_requestSite_dont_conflict_with_site
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
organisation_title
=
self
.
generateNewOrganisationTitle
()
person
.
requestSite
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertNotEqual
(
None
,
organisation_relative_url
)
organisation
=
person
.
restrictedTraverse
(
organisation_relative_url
)
self
.
assertEqual
(
organisation
.
getTitle
(),
organisation_title
)
self
.
assertEqual
(
organisation
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
organisation
.
getRoleId
(),
"host"
)
self
.
assertIn
(
"SITE-"
,
organisation
.
getReference
())
organisation2
=
organisation
.
Base_createCloneDocument
(
batch_mode
=
1
)
organisation2
.
edit
(
role
=
"client"
)
organisation2
.
validate
()
person
.
REQUEST
.
set
(
'organisation_relative_url'
,
None
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
person
.
requestSite
(
organisation_title
=
organisation_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
same_organisation_relative_url
=
person
.
REQUEST
.
get
(
'organisation_relative_url'
)
self
.
assertEqual
(
same_organisation_relative_url
,
organisation_relative_url
)
class
TestSlapOSCorePersonRequestNetwork
(
SlapOSTestCaseMixin
):
def
generateNewNetworkTitle
(
self
):
return
'My Network %s'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestNetwork_title_is_mandatoty
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestNetwork
)
def
test_Person_requestNetwork
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
network_title
=
self
.
generateNewNetworkTitle
()
person
.
requestNetwork
(
network_title
=
network_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
network_relative_url
=
person
.
REQUEST
.
get
(
'computer_network_relative_url'
)
self
.
assertNotEqual
(
None
,
network_relative_url
)
network
=
person
.
restrictedTraverse
(
network_relative_url
)
self
.
assertEqual
(
network
.
getSourceAdministration
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
network
.
getTitle
(),
network_title
)
self
.
assertEqual
(
network
.
getValidationState
(),
"validated"
)
self
.
assertIn
(
"NET-"
,
network
.
getReference
())
def
test_Person_requestNetwork_duplicated
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
network_title
=
self
.
generateNewNetworkTitle
()
person
.
requestNetwork
(
network_title
=
network_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
network_relative_url
=
person
.
REQUEST
.
get
(
'computer_network_relative_url'
)
self
.
assertNotEqual
(
None
,
network_relative_url
)
network
=
person
.
restrictedTraverse
(
network_relative_url
)
self
.
assertEqual
(
network
.
getSourceAdministration
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
network
.
getTitle
(),
network_title
)
self
.
assertEqual
(
network
.
getValidationState
(),
"validated"
)
self
.
assertIn
(
"NET-"
,
network
.
getReference
())
network2
=
network
.
Base_createCloneDocument
(
batch_mode
=
1
)
network2
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertRaises
(
NotImplementedError
,
person
.
requestNetwork
,
network_title
=
network_title
)
def
test_Person_requestNetwork_request_again
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
network_title
=
self
.
generateNewNetworkTitle
()
person
.
requestNetwork
(
network_title
=
network_title
)
# check what is returned via request
network_relative_url
=
person
.
REQUEST
.
get
(
'computer_network_relative_url'
)
self
.
assertNotEqual
(
None
,
network_relative_url
)
self
.
tic
()
self
.
login
()
# check what is returned via request
person
.
REQUEST
.
set
(
'computer_network_relative_url'
,
None
)
self
.
login
(
person
.
getUserId
())
person
.
requestNetwork
(
network_title
=
network_title
)
# check what is returned via request
same_network_relative_url
=
person
.
REQUEST
.
get
(
'computer_network_relative_url'
)
self
.
assertEqual
(
same_network_relative_url
,
network_relative_url
)
class
TestSlapOSCorePersonRequestToken
(
SlapOSTestCaseMixin
):
def
generateNewTokenUrl
(
self
):
return
'https://%s.no.where/%s'
%
(
self
.
generateNewId
(),
self
.
generateNewId
())
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestToken_requested_url_is_mandatory
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestToken
)
def
test_Person_requestToken
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
request_url
=
self
.
generateNewTokenUrl
()
person
.
requestToken
(
request_url
=
request_url
)
self
.
tic
()
self
.
login
()
# check what is returned via request
token_id
=
person
.
REQUEST
.
get
(
'token'
)
self
.
assertNotEqual
(
None
,
token_id
)
token
=
self
.
portal
.
access_token_module
[
token_id
]
self
.
assertEqual
(
token
.
getAgent
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
token
.
getUrlString
(),
request_url
)
self
.
assertEqual
(
token
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
token
.
getPortalType
(),
"One Time Restricted Access Token"
)
self
.
assertEqual
(
token
.
getUrlMethod
(),
"POST"
)
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/person_slap_interface_workflow/script_Person_requestOrganisation.py
View file @
8fc00603
...
@@ -21,18 +21,18 @@ if (portal.portal_activities.countMessageWithTag(tag) > 0):
...
@@ -21,18 +21,18 @@ if (portal.portal_activities.countMessageWithTag(tag) > 0):
raise
NotImplementedError
(
tag
)
raise
NotImplementedError
(
tag
)
organisation_portal_type
=
"Organisation"
organisation_portal_type
=
"Organisation"
organisation_list
=
portal
.
portal_catalog
.
portal_catalog
(
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
,
portal_type
=
organisation_portal_type
,
title
=
organisation_title
,
title
=
organisation_title
,
# check if this works
limit
=
2
)
if
i
.
getRole
()
==
role_id
]
role_id
=
role_id
,
limit
=
2
)
if
len
(
organisation_list
)
==
2
:
if
len
(
organisation_list
)
==
2
:
raise
NotImplementedError
raise
NotImplementedError
elif
len
(
organisation_list
)
==
1
:
elif
len
(
organisation_list
)
==
1
:
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation_list
[
0
].
getRelativeUrl
())
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation_list
[
0
].
getRelativeUrl
())
context
.
REQUEST
.
set
(
"organisation_reference"
,
organisation_list
[
0
].
getReference
())
else
:
else
:
module
=
portal
.
getDefaultModule
(
portal_type
=
organisation_portal_type
)
module
=
portal
.
getDefaultModule
(
portal_type
=
organisation_portal_type
)
organisation
=
module
.
newContent
(
organisation
=
module
.
newContent
(
...
@@ -42,6 +42,4 @@ else:
...
@@ -42,6 +42,4 @@ else:
activate_kw
=
{
'tag'
:
tag
}
activate_kw
=
{
'tag'
:
tag
}
)
)
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation
.
getRelativeUrl
())
context
.
REQUEST
.
set
(
"organisation_relative_url"
,
organisation
.
getRelativeUrl
())
context
.
REQUEST
.
set
(
"organisation_reference"
,
organisation
.
getReference
())
organisation
.
approveRegistration
()
organisation
.
approveRegistration
()
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