Commit 4f1fe433 authored by wenjie.zheng's avatar wenjie.zheng

WorkflowScript.py, patches/PythonScript.py, ERP5Site.py: clean up.

parent c907ad07
...@@ -2186,6 +2186,7 @@ class ERP5Generator(PortalGenerator): ...@@ -2186,6 +2186,7 @@ class ERP5Generator(PortalGenerator):
def setup(self, p, create_userfolder, **kw): def setup(self, p, create_userfolder, **kw):
update = kw.get('update', 0) update = kw.get('update', 0)
if getattr(p, 'setDefaultSorting', None) is not None: if getattr(p, 'setDefaultSorting', None) is not None:
p.setDefaultSorting('id', 0) p.setDefaultSorting('id', 0)
......
...@@ -51,7 +51,7 @@ PythonScript.manage_main = manage_editForm ...@@ -51,7 +51,7 @@ PythonScript.manage_main = manage_editForm
PythonScript.manage_editDocument = manage_editForm PythonScript.manage_editDocument = manage_editForm
PythonScript.manage_editForm = manage_editForm PythonScript.manage_editForm = manage_editForm
# following methods are design for showAsXML function: # following methods are necessary for showAsXML function:
def pyscript_getBody(self): def pyscript_getBody(self):
return self._body return self._body
def pyscript_getParams(self): def pyscript_getParams(self):
......
...@@ -52,16 +52,10 @@ class WorkflowScript(PythonScript, IdAsReferenceMixin("script_", "prefix")): ...@@ -52,16 +52,10 @@ class WorkflowScript(PythonScript, IdAsReferenceMixin("script_", "prefix")):
, PropertySheet.WorkflowScript , PropertySheet.WorkflowScript
) )
def __init__(self, *args, **kw):
PythonScript.__init__(self, *args, **kw)
def __call__(self): def __call__(self):
r_url = self.REQUEST.get('URL') r_url = self.REQUEST.get('URL')
return self.REQUEST.RESPONSE.redirect(r_url+'/view') return self.REQUEST.RESPONSE.redirect(r_url+'/view')
execute = PythonScript.__call__ execute = PythonScript.__call__
# We need to take __setstate__ from PythonScript in order to
# generate _v_ft attributes which is necessary to run the script
__setstate__ = PythonScript.__setstate__
InitializeClass(WorkflowScript) InitializeClass(WorkflowScript)
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