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
0
Merge Requests
0
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
Roque
slapos.core
Commits
cbcdd677
Commit
cbcdd677
authored
Apr 01, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master: Get rid of ERP5Site_getAuthenticatedMemberPersonValue
This API is deprecated, replaced by appropriated one
parent
f2940825
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
48 additions
and
42 deletions
+48
-42
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputerNetwork_getSoftwareReleaseAllocableState.py
...cloud/ComputerNetwork_getSoftwareReleaseAllocableState.py
+5
-4
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputerNetwork_init.py
...ateItem/portal_skins/slapos_cloud/ComputerNetwork_init.py
+1
-1
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+1
-1
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.py
...em/portal_components/test.erp5.testSlapOSCloudWorkflow.py
+19
-19
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_approveRegistration.py
...nterface_workflow/scripts/Computer_approveRegistration.py
+1
-1
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/WebSection_getUserCriticalTicketList.py
...os_crm_monitoring/WebSection_getUserCriticalTicketList.py
+2
-1
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/WebSection_getUserTicketList.py
...ins/slapos_crm_monitoring/WebSection_getUserTicketList.py
+1
-1
master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/scripts/WebMessage_stopAndReopenTicket.py
...action_workflow/scripts/WebMessage_stopAndReopenTicket.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getComputerToken.py
...rtal_skins/slapos_hal_json_style/Base_getComputerToken.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getCredentialToken.py
...al_skins/slapos_hal_json_style/Base_getCredentialToken.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getCriticalFeedUrl.py
...al_skins/slapos_hal_json_style/Base_getCriticalFeedUrl.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getFeedUrl.py
...tem/portal_skins/slapos_hal_json_style/Base_getFeedUrl.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_getCertificate.py
...rtal_skins/slapos_hal_json_style/Person_getCertificate.py
+3
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_requestComputer.py
...tal_skins/slapos_hal_json_style/Person_requestComputer.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_revokeCertificate.py
...l_skins/slapos_hal_json_style/Person_revokeCertificate.py
+3
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/SoftwareRelease_requestHostingSubscription.py
..._json_style/SoftwareRelease_requestHostingSubscription.py
+1
-1
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/AccountingTransaction_getPaymentState.py
...ns/slapos_payzen/AccountingTransaction_getPaymentState.py
+1
-1
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.py
...ayzen/PaymentTransaction_redirectToManualPayzenPayment.py
+1
-1
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToSubscriptionManualPayzenPayment.py
...tTransaction_redirectToSubscriptionManualPayzenPayment.py
+1
-1
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+2
-2
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputerNetwork_getSoftwareReleaseAllocableState.py
View file @
cbcdd677
...
@@ -3,7 +3,8 @@ network = context
...
@@ -3,7 +3,8 @@ network = context
# XXX - The use of current authenticated person will return always 'Close' if
# XXX - The use of current authenticated person will return always 'Close' if
# the person is administrator (such as 'zope' user) but not the owner of computer
# the person is administrator (such as 'zope' user) but not the owner of computer
#
#
# person = context.ERP5Site_getAuthenticatedMemberPersonValue()
# person = portal.portal_membership.getAuthenticatedMember().getUserValue()
allocation_state
=
'Close'
allocation_state
=
'Close'
software_type
=
''
software_type
=
''
filter_kw
=
{}
filter_kw
=
{}
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputerNetwork_init.py
View file @
cbcdd677
...
@@ -6,5 +6,5 @@ reference = "NET-%s" % portal.portal_ids.generateNewId(
...
@@ -6,5 +6,5 @@ reference = "NET-%s" % portal.portal_ids.generateNewId(
context
.
edit
(
reference
=
reference
)
context
.
edit
(
reference
=
reference
)
#source_administration=
context.ERP5Site_getAuthenticatedMemberPerson
Value().getRelativeUrl()
#source_administration=
portal.portal_membership.getAuthenticatedMember().getUser
Value().getRelativeUrl()
#network.validate()
#network.validate()
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
cbcdd677
...
@@ -88,7 +88,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
...
@@ -88,7 +88,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
assertNotEqual
(
None
,
welcome_message
)
self
.
assertNotEqual
(
None
,
welcome_message
)
def
_getCurrentHostingSubscriptionList
(
self
):
def
_getCurrentHostingSubscriptionList
(
self
):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
person
is
not
None
:
if
person
is
not
None
:
return
self
.
portal
.
portal_catalog
(
return
self
.
portal
.
portal_catalog
(
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.py
View file @
cbcdd677
...
@@ -390,7 +390,7 @@ class TestSlapOSCorePersonComputerSupply(SlapOSTestCaseMixin):
...
@@ -390,7 +390,7 @@ class TestSlapOSCorePersonComputerSupply(SlapOSTestCaseMixin):
# Login as new user
# Login as new user
self
.
login
(
person_user
.
getUserId
())
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
...
@@ -1919,14 +1919,14 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -1919,14 +1919,14 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
# Login as new user
# Login as new user
self
.
login
(
person_user
.
getUserId
())
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
pass
pass
def
test_Person_requestSoftwareInstance_requiredParameter
(
self
):
def
test_Person_requestSoftwareInstance_requiredParameter
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2022,7 +2022,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2022,7 +2022,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
)
)
def
test_Person_requestSoftwareInstance_acceptedState
(
self
):
def
test_Person_requestSoftwareInstance_acceptedState
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2082,7 +2082,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2082,7 +2082,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
None
,
hosting_subscription
)
self
.
assertEqual
(
None
,
hosting_subscription
)
def
test_Person_requestSoftwareInstance_returnHostingSubscriptionUrl
(
self
):
def
test_Person_requestSoftwareInstance_returnHostingSubscriptionUrl
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2109,7 +2109,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2109,7 +2109,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
hosting_subscription
.
getPortalType
())
hosting_subscription
.
getPortalType
())
def
test_Person_requestSoftwareInstance_createHostingSubscription
(
self
):
def
test_Person_requestSoftwareInstance_createHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2149,7 +2149,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2149,7 +2149,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
"validated"
,
hosting_subscription
.
getValidationState
())
self
.
assertEqual
(
"validated"
,
hosting_subscription
.
getValidationState
())
def
test_Person_requestSoftwareInstance_HostingSubscriptionNotReindexed
(
self
):
def
test_Person_requestSoftwareInstance_HostingSubscriptionNotReindexed
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2185,7 +2185,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2185,7 +2185,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
@
expectedFailure
@
expectedFailure
def
test_Person_requestSoftwareInstance_updateHostingSubscription
(
self
):
def
test_Person_requestSoftwareInstance_updateHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2253,7 +2253,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2253,7 +2253,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
"validated"
,
hosting_subscription
.
getValidationState
())
self
.
assertEqual
(
"validated"
,
hosting_subscription
.
getValidationState
())
def
test_Person_requestSoftwareInstance_duplicatedHostingSubscription
(
self
):
def
test_Person_requestSoftwareInstance_duplicatedHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2295,7 +2295,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2295,7 +2295,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
)
)
def
test_Person_requestSoftwareInstance_HostingSubscriptionNewTitle
(
self
):
def
test_Person_requestSoftwareInstance_HostingSubscriptionNewTitle
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2363,7 +2363,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2363,7 +2363,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
"validated"
,
hosting_subscription2
.
getValidationState
())
self
.
assertEqual
(
"validated"
,
hosting_subscription2
.
getValidationState
())
def
test_Person_requestSoftwareInstance_deletedHostingSubscription
(
self
):
def
test_Person_requestSoftwareInstance_deletedHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2402,7 +2402,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
...
@@ -2402,7 +2402,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
"destroy_requested"
,
hosting_subscription
.
getSlapState
())
self
.
assertEqual
(
"destroy_requested"
,
hosting_subscription
.
getSlapState
())
def
test_Person_requestSoftwareInstance_noConflictWithDeletedHostingSubscription
(
self
):
def
test_Person_requestSoftwareInstance_noConflictWithDeletedHostingSubscription
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
software_title
=
"test"
software_title
=
"test"
...
@@ -2467,14 +2467,14 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
...
@@ -2467,14 +2467,14 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
# Login as new user
# Login as new user
self
.
login
(
person_user
.
getUserId
())
self
.
login
(
person_user
.
getUserId
())
new_person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
pass
pass
def
test_request_requiredParameter
(
self
):
def
test_request_requiredParameter
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
# computer_title is mandatory
# computer_title is mandatory
self
.
assertRaises
(
TypeError
,
person
.
requestComputer
)
self
.
assertRaises
(
TypeError
,
person
.
requestComputer
)
...
@@ -2484,7 +2484,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
...
@@ -2484,7 +2484,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
person
.
requestComputer
(
computer_title
=
computer_title
)
person
.
requestComputer
(
computer_title
=
computer_title
)
def
test_request
(
self
):
def
test_request
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
computer_title
=
self
.
generateNewComputerTitle
()
computer_title
=
self
.
generateNewComputerTitle
()
person
.
requestComputer
(
computer_title
=
computer_title
)
person
.
requestComputer
(
computer_title
=
computer_title
)
...
@@ -2499,7 +2499,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
...
@@ -2499,7 +2499,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
self
.
assertNotEqual
(
None
,
computer_reference
)
self
.
assertNotEqual
(
None
,
computer_reference
)
def
test_request_createdComputer
(
self
):
def
test_request_createdComputer
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
previous_id
=
self
.
getPortalObject
().
portal_ids
\
previous_id
=
self
.
getPortalObject
().
portal_ids
\
.
generateNewId
(
id_group
=
'slap_computer_reference'
,
.
generateNewId
(
id_group
=
'slap_computer_reference'
,
...
@@ -2530,7 +2530,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
...
@@ -2530,7 +2530,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
self
.
assertEqual
(
'open'
,
computer
.
getCapacityScope
())
self
.
assertEqual
(
'open'
,
computer
.
getCapacityScope
())
def
test_request_notReindexedCompute
(
self
):
def
test_request_notReindexedCompute
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
computer_title
=
self
.
generateNewComputerTitle
()
computer_title
=
self
.
generateNewComputerTitle
()
person
.
requestComputer
(
computer_title
=
computer_title
)
person
.
requestComputer
(
computer_title
=
computer_title
)
...
@@ -2539,7 +2539,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
...
@@ -2539,7 +2539,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
computer_title
=
computer_title
)
computer_title
=
computer_title
)
def
test_multiple_request_createdComputer
(
self
):
def
test_multiple_request_createdComputer
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
previous_id
=
self
.
getPortalObject
().
portal_ids
\
previous_id
=
self
.
getPortalObject
().
portal_ids
\
.
generateNewId
(
id_group
=
'slap_computer_reference'
,
.
generateNewId
(
id_group
=
'slap_computer_reference'
,
...
@@ -2624,7 +2624,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
...
@@ -2624,7 +2624,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
self
.
assertEqual
(
'open'
,
computer2
.
getCapacityScope
())
self
.
assertEqual
(
'open'
,
computer2
.
getCapacityScope
())
def
test_request_duplicatedComputer
(
self
):
def
test_request_duplicatedComputer
(
self
):
person
=
self
.
getPortalObject
().
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
computer_title
=
self
.
generateNewComputerTitle
()
computer_title
=
self
.
generateNewComputerTitle
()
person
.
requestComputer
(
computer_title
=
computer_title
)
person
.
requestComputer
(
computer_title
=
computer_title
)
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/computer_slap_interface_workflow/scripts/Computer_approveRegistration.py
View file @
cbcdd677
computer
=
state_change
[
'object'
]
computer
=
state_change
[
'object'
]
portal
=
computer
.
getPortalObject
()
portal
=
computer
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
computer
.
edit
(
computer
.
edit
(
allocation_scope
=
'open/personal'
,
allocation_scope
=
'open/personal'
,
source_administration_value
=
person
,
source_administration_value
=
person
,
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/WebSection_getUserCriticalTicketList.py
View file @
cbcdd677
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
kw
[
'portal_type'
]
=
[
"Support Request"
,
"Regularisation Request"
,
"Upgrade Decision"
]
kw
[
'portal_type'
]
=
[
"Support Request"
,
"Regularisation Request"
,
"Upgrade Decision"
]
person
=
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
person
:
if
person
:
kw
[
'default_destination_decision_uid'
]
=
person
.
getUid
()
kw
[
'default_destination_decision_uid'
]
=
person
.
getUid
()
kw
[
'simulation_state'
]
=
"NOT cancelled"
kw
[
'simulation_state'
]
=
"NOT cancelled"
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/WebSection_getUserTicketList.py
View file @
cbcdd677
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
kw
[
'portal_type'
]
=
[
"Support Request"
,
"Regularisation Request"
,
"Upgrade Decision"
]
kw
[
'portal_type'
]
=
[
"Support Request"
,
"Regularisation Request"
,
"Upgrade Decision"
]
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
person
:
if
person
:
kw
[
'default_destination_decision_uid'
]
=
person
.
getUid
()
kw
[
'default_destination_decision_uid'
]
=
person
.
getUid
()
kw
[
'simulation_state'
]
=
"NOT cancelled"
kw
[
'simulation_state'
]
=
"NOT cancelled"
...
...
master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/scripts/WebMessage_stopAndReopenTicket.py
View file @
cbcdd677
web_message
=
state_object
[
"object"
]
web_message
=
state_object
[
"object"
]
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
person
is
None
:
if
person
is
None
:
return
return
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getComputerToken.py
View file @
cbcdd677
import
json
import
json
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
web_site
=
context
.
getWebSiteValue
()
web_site
=
context
.
getWebSiteValue
()
request_method
=
"POST"
request_method
=
"POST"
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getCredentialToken.py
View file @
cbcdd677
import
json
import
json
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
# Revoke user certificate
# Revoke user certificate
try
:
try
:
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getCriticalFeedUrl.py
View file @
cbcdd677
import
json
import
json
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
person
is
None
:
if
person
is
None
:
raise
ValueError
(
"User Not Found"
)
raise
ValueError
(
"User Not Found"
)
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getFeedUrl.py
View file @
cbcdd677
import
json
import
json
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
person
is
None
:
if
person
is
None
:
raise
ValueError
(
"User Not Found"
)
raise
ValueError
(
"User Not Found"
)
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_getCertificate.py
View file @
cbcdd677
person
=
context
.
ERP5Site_getAuthenticatedMemberPersonValue
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
request
=
context
.
REQUEST
request
=
context
.
REQUEST
response
=
request
.
RESPONSE
response
=
request
.
RESPONSE
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_requestComputer.py
View file @
cbcdd677
import
json
import
json
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
request
=
context
.
REQUEST
request
=
context
.
REQUEST
response
=
request
.
RESPONSE
response
=
request
.
RESPONSE
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_revokeCertificate.py
View file @
cbcdd677
""" This script is required due the ValueError, should be more HTTP friendly.
""" This script is required due the ValueError, should be more HTTP friendly.
"""
"""
person
=
context
.
ERP5Site_getAuthenticatedMemberPersonValue
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
request
=
context
.
REQUEST
request
=
context
.
REQUEST
response
=
request
.
RESPONSE
response
=
request
.
RESPONSE
import
json
import
json
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/SoftwareRelease_requestHostingSubscription.py
View file @
cbcdd677
...
@@ -26,7 +26,7 @@ if hosting_subscription is not None:
...
@@ -26,7 +26,7 @@ if hosting_subscription is not None:
# The URL should come from the URL Probably
# The URL should come from the URL Probably
url
=
context
.
getUrlString
()
url
=
context
.
getUrlString
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
person
is
None
:
if
person
is
None
:
raise
ValueError
(
"You cannot request without been logged in as a user."
)
raise
ValueError
(
"You cannot request without been logged in as a user."
)
...
...
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/AccountingTransaction_getPaymentState.py
View file @
cbcdd677
...
@@ -35,7 +35,7 @@ else:
...
@@ -35,7 +35,7 @@ else:
result
=
"Unpaid"
result
=
"Unpaid"
else
:
else
:
# Check if mapping exists
# Check if mapping exists
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
payzen_id
=
person
.
Person_restrictMethodAsShadowUser
(
payzen_id
=
person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
person
,
shadow_document
=
person
,
callable_object
=
payment
.
PaymentTransaction_getPayzenId
,
callable_object
=
payment
.
PaymentTransaction_getPayzenId
,
...
...
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.py
View file @
cbcdd677
from
zExceptions
import
Unauthorized
from
zExceptions
import
Unauthorized
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
if
getattr
(
context
,
"PaymentTransaction_getVADSUrlDict"
,
None
)
is
None
:
if
getattr
(
context
,
"PaymentTransaction_getVADSUrlDict"
,
None
)
is
None
:
raise
ValueError
(
"PaymentTransaction_getVADSUrlDict is missing on this site"
)
raise
ValueError
(
"PaymentTransaction_getVADSUrlDict is missing on this site"
)
...
...
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToSubscriptionManualPayzenPayment.py
View file @
cbcdd677
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
anonymous pay their Payment Transactions before login.
anonymous pay their Payment Transactions before login.
"""
"""
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
def
wrapWithShadow
(
payment_transaction
,
web_site
):
def
wrapWithShadow
(
payment_transaction
,
web_site
):
return
payment_transaction
.
PaymentTransaction_redirectToManualPayzenPayment
(
web_site
)
return
payment_transaction
.
PaymentTransaction_redirectToManualPayzenPayment
(
web_site
)
...
...
master/product/Vifib/Tool/SlapTool.py
View file @
cbcdd677
...
@@ -548,7 +548,7 @@ class SlapTool(BaseTool):
...
@@ -548,7 +548,7 @@ class SlapTool(BaseTool):
@
convertToREST
@
convertToREST
def
_requestComputer
(
self
,
computer_title
):
def
_requestComputer
(
self
,
computer_title
):
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
person
.
requestComputer
(
computer_title
=
computer_title
)
person
.
requestComputer
(
computer_title
=
computer_title
)
computer
=
Computer
(
self
.
REQUEST
.
get
(
'computer_reference'
).
decode
(
"UTF-8"
))
computer
=
Computer
(
self
.
REQUEST
.
get
(
'computer_reference'
).
decode
(
"UTF-8"
))
return
xml_marshaller
.
xml_marshaller
.
dumps
(
computer
)
return
xml_marshaller
.
xml_marshaller
.
dumps
(
computer
)
...
@@ -1303,7 +1303,7 @@ class SlapTool(BaseTool):
...
@@ -1303,7 +1303,7 @@ class SlapTool(BaseTool):
self
.
_storeLastData
(
key
,
value
)
self
.
_storeLastData
(
key
,
value
)
else
:
else
:
# requested as root, so done by human
# requested as root, so done by human
person
=
portal
.
ERP5Site_getAuthenticatedMemberPerson
Value
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUser
Value
()
kw
=
dict
(
software_release
=
software_release
,
kw
=
dict
(
software_release
=
software_release
,
software_type
=
software_type
,
software_type
=
software_type
,
software_title
=
partition_reference
,
software_title
=
partition_reference
,
...
...
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