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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
1bf56d7d
Commit
1bf56d7d
authored
Jun 30, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Guards on PythonScript when rendered with namespace
This fixes a regression in commit
b9c41350
parent
b6be9c26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
product/ERP5Type/patches/PythonScript.py
product/ERP5Type/patches/PythonScript.py
+7
-1
No files found.
product/ERP5Type/patches/PythonScript.py
View file @
1bf56d7d
...
@@ -176,11 +176,17 @@ class _(PatchClass(PythonScript)):
...
@@ -176,11 +176,17 @@ class _(PatchClass(PythonScript)):
def
__call__
(
self
,
*
args
,
**
kw
):
def
__call__
(
self
,
*
args
,
**
kw
):
'''Calls the script.'''
'''Calls the script.'''
self
.
checkGuard
(
True
)
# patch
self
.
checkGuard
(
True
)
# patch
return
self
.
_bindAndExec
(
args
,
kw
,
None
)
return
self
.
_
orig_
bindAndExec
(
args
,
kw
,
None
)
security
.
declarePublic
(
"render"
)
security
.
declarePublic
(
"render"
)
render
=
__call__
render
=
__call__
# For __render_with_namespace__ (we prefer to monkey-patch __call__
# because it's called more often, and this makes debugging easier)
_orig_bindAndExec
=
PythonScript
.
_bindAndExec
def
_bindAndExec
(
self
,
args
,
kw
,
caller_namespace
):
return
self
(
*
args
,
**
kw
)
# caller_namespace not used by PythonScript
addGuard
(
PythonScript
,
'Change Python Scripts'
)
addGuard
(
PythonScript
,
'Change Python Scripts'
)
InitializeClass
(
PythonScript
)
InitializeClass
(
PythonScript
)
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