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
Titouan Soulard
slapos.core
Commits
7fa55f14
Commit
7fa55f14
authored
May 12, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: drop Base_instanceXmlToDict
parent
39054120
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
95 deletions
+3
-95
master/bt5/slapos_subscription_request/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSubscriptionRequest.py
...al_components/extension.erp5.SlapOSSubscriptionRequest.py
+0
-20
master/bt5/slapos_subscription_request/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSubscriptionRequest.xml
...l_components/extension.erp5.SlapOSSubscriptionRequest.xml
+3
-24
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Base_instanceXmlToDict.xml
...ns/slapos_subscription_request/Base_instanceXmlToDict.xml
+0
-28
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+0
-23
No files found.
master/bt5/slapos_subscription_request/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSubscriptionRequest.py
View file @
7fa55f14
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
lxml
import
etree
from
zExceptions
import
Unauthorized
from
zLOG
import
LOG
,
INFO
def
SubscriptionRequest_saveTransactionalUser
(
self
,
person
=
None
):
if
person
.
getPortalType
()
==
"Person"
:
...
...
@@ -14,24 +12,6 @@ def SubscriptionRequest_getTransactionalUser(self, REQUEST=None):
raise
Unauthorized
return
getTransactionalVariable
().
get
(
"transactional_user"
,
None
)
def
Base_instanceXmlToDict
(
self
,
xml
):
result_dict
=
{}
try
:
if
xml
is
not
None
and
xml
!=
''
:
tree
=
etree
.
fromstring
(
xml
)
for
element
in
tree
.
findall
(
'parameter'
):
key
=
element
.
get
(
'id'
)
value
=
result_dict
.
get
(
key
,
None
)
if
value
is
not
None
:
value
=
value
+
' '
+
element
.
text
else
:
value
=
element
.
text
result_dict
[
key
]
=
value
except
(
etree
.
XMLSchemaError
,
etree
.
XMLSchemaParseError
,
#pylint: disable=catching-non-exception
etree
.
XMLSchemaValidateError
,
etree
.
XMLSyntaxError
):
#pylint: disable=catching-non-exception
LOG
(
'SubscriptionRequest'
,
INFO
,
'Issue during parsing xml:'
,
error
=
True
)
return
result_dict
def
SubscriptionCondition_renderParameter
(
self
,
amount
=
0
,
**
kw
):
method_id
=
self
.
getParameterTemplateRendererMethodId
()
if
method_id
is
not
None
:
...
...
master/bt5/slapos_subscription_request/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSubscriptionRequest.xml
View file @
7fa55f14
...
...
@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
SlapOSSubscriptionRequest
</string>
</value>
...
...
@@ -55,28 +49,13 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -89,7 +68,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -98,7 +77,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Base_instanceXmlToDict.xml
deleted
100644 → 0
View file @
39054120
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
Base_instanceXmlToDict
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
SlapOSSubscriptionRequest
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_instanceXmlToDict
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
7fa55f14
...
...
@@ -103,29 +103,6 @@ class TestSubscriptionSkinsMixin(SlapOSTestCaseMixinWithAbort):
self
.
tic
()
return
subscription_request
class
TestBase_instanceXmlToDict
(
TestSubscriptionSkinsMixin
):
def
test_Base_instanceXmlToDict
(
self
):
xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>"""
self
.
assertEqual
(
self
.
portal
.
Base_instanceXmlToDict
(
xml
),
{})
def
test_Base_instanceXmlToDict_simple_parameter
(
self
):
xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="oi">couscous</parameter>
<parameter id="zz">yy</parameter>
</instance>"""
self
.
assertEqual
(
self
.
portal
.
Base_instanceXmlToDict
(
xml
),
{
'oi'
:
'couscous'
,
'zz'
:
'yy'
})
def
test_Base_instanceXmlToDict_serialise_parameter
(
self
):
xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="_">{"aa": "bb"}</parameter>
</instance>"""
self
.
assertEqual
(
self
.
portal
.
Base_instanceXmlToDict
(
xml
),
{
'_'
:
'{"aa": "bb"}'
})
class
TestSubscriptionCondition_renderParameter
(
TestSubscriptionSkinsMixin
):
...
...
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