Commit 504ce33f authored by Georgios Dagkakis's avatar Georgios Dagkakis

PythonScript: patch so that it raises if a space exists in given id

parent ae932987
......@@ -22,6 +22,7 @@ from OFS.misc_ import p_
from App.ImageFile import ImageFile
from Acquisition import aq_base, aq_parent
from zExceptions import Forbidden
from Shared.DC.Scripts.Script import defaultBindings
### Guards
......@@ -151,6 +152,15 @@ class _(PatchClass(PythonScript)):
security = ClassSecurityInfo()
def __init__(self, id):
# START PATCH: do not allow spaces in id
if ' ' in id:
raise ValueError('PythonScript id cannot contain spaces!')
# END PATCH: do not allow spaces in id
self.id = id
self.ZBindings_edit(defaultBindings)
self._makeFunction()
# Add proxy role icon in ZMI
def om_icons(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment