Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
701d671e
Commit
701d671e
authored
Mar 13, 2023
by
Kazuhiko Shiozaki
Committed by
Arnaud Fontaine
Jul 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! TemplateTool: use json to encode repository business template uid
parent
8319f9c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+3
-3
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
701d671e
...
@@ -66,7 +66,7 @@ from Products.ERP5Type.Message import translateString
...
@@ -66,7 +66,7 @@ from Products.ERP5Type.Message import translateString
from
zLOG
import
LOG
,
INFO
,
WARNING
from
zLOG
import
LOG
,
INFO
,
WARNING
import
subprocess
import
subprocess
import
time
import
time
from
Products.ERP5Type.Utils
import
bytes2str
from
Products.ERP5Type.Utils
import
bytes2str
,
str2bytes
,
unicode2str
import
json
import
json
WIN
=
os
.
name
==
'nt'
WIN
=
os
.
name
==
'nt'
...
@@ -712,7 +712,7 @@ class TemplateTool (BaseTool):
...
@@ -712,7 +712,7 @@ class TemplateTool (BaseTool):
Return a repository and an id.
Return a repository and an id.
"""
"""
repository, id = json.loads(b64decode(uid))
repository, id = json.loads(b64decode(uid))
return
repository.encode('
utf
-
8
'), id.encode('
utf
-
8
'
)
return
unicode2str(repository), unicode2str(id
)
security.declarePublic( '
encodeRepositoryBusinessTemplateUid
' )
security.declarePublic( '
encodeRepositoryBusinessTemplateUid
' )
def encodeRepositoryBusinessTemplateUid(self, repository, id):
def encodeRepositoryBusinessTemplateUid(self, repository, id):
...
@@ -720,7 +720,7 @@ class TemplateTool (BaseTool):
...
@@ -720,7 +720,7 @@ class TemplateTool (BaseTool):
encode the repository and the id of a business template.
encode the repository and the id of a business template.
Return an uid.
Return an uid.
"""
"""
return b64encode(
json.dumps((repository, id
)))
return b64encode(
str2bytes(json.dumps((repository, id)
)))
security.declarePublic('
compareVersionStrings
')
security.declarePublic('
compareVersionStrings
')
def compareVersionStrings(self, version, comparing_string):
def compareVersionStrings(self, version, comparing_string):
...
...
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