Commit 50761e03 authored by Tres Seaver's avatar Tres Seaver

Zap string exceptions.

parent 8533ba51
...@@ -4,6 +4,9 @@ Products.DCWorkflow Changelog ...@@ -4,6 +4,9 @@ Products.DCWorkflow Changelog
2.3.0-alpha (unreleased) 2.3.0-alpha (unreleased)
------------------------ ------------------------
- Removed string exceptions.
(https://bugs.launchpad.net/zope-cmf/+bug/952301)
- Made sure converted tools are used as utilities. - Made sure converted tools are used as utilities.
- Don't crash worklist's ``manage_main`` if variables are Expression objects. - Don't crash worklist's ``manage_main`` if variables are Expression objects.
......
...@@ -19,6 +19,7 @@ from Acquisition import aq_base ...@@ -19,6 +19,7 @@ from Acquisition import aq_base
from Acquisition import aq_inner from Acquisition import aq_inner
from Acquisition import aq_parent from Acquisition import aq_parent
from OFS.Folder import Folder from OFS.Folder import Folder
from zExceptions import BadRequest
_marker = [] # Create a new marker object. _marker = [] # Create a new marker object.
...@@ -53,7 +54,7 @@ class ContainerTab(Folder): ...@@ -53,7 +54,7 @@ class ContainerTab(Folder):
def _checkId(self, id, allow_dup=0): def _checkId(self, id, allow_dup=0):
if not allow_dup: if not allow_dup:
if self._mapping.has_key(id): if self._mapping.has_key(id):
raise 'Bad Request', 'The id "%s" is already in use.' % id raise BadRequest('The id "%s" is already in use.' % id)
return Folder._checkId(self, id, allow_dup) return Folder._checkId(self, id, allow_dup)
def _getOb(self, name, default=_marker): def _getOb(self, name, default=_marker):
...@@ -111,7 +112,7 @@ class ContainerTab(Folder): ...@@ -111,7 +112,7 @@ class ContainerTab(Folder):
def manage_renameObjects(self, ids=[], new_ids=[], REQUEST=None): def manage_renameObjects(self, ids=[], new_ids=[], REQUEST=None):
"""Rename several sub-objects""" """Rename several sub-objects"""
if len(ids) != len(new_ids): if len(ids) != len(new_ids):
raise 'Bad Request', 'Please rename each listed object.' raise BadRequest('Please rename each listed object.')
for i in range(len(ids)): for i in range(len(ids)):
if ids[i] != new_ids[i]: if ids[i] != new_ids[i]:
self.manage_renameObject(ids[i], new_ids[i]) self.manage_renameObject(ids[i], new_ids[i])
......
...@@ -21,6 +21,7 @@ from Acquisition import aq_parent ...@@ -21,6 +21,7 @@ from Acquisition import aq_parent
from App.class_init import InitializeClass from App.class_init import InitializeClass
from App.special_dtml import DTMLFile from App.special_dtml import DTMLFile
from OFS.SimpleItem import SimpleItem from OFS.SimpleItem import SimpleItem
from zExceptions import BadRequest
from Products.CMFCore.Expression import Expression from Products.CMFCore.Expression import Expression
from Products.DCWorkflow.ContainerTab import ContainerTab from Products.DCWorkflow.ContainerTab import ContainerTab
...@@ -148,7 +149,7 @@ class Variables(ContainerTab): ...@@ -148,7 +149,7 @@ class Variables(ContainerTab):
def _checkId(self, id, allow_dup=0): def _checkId(self, id, allow_dup=0):
wf_def = aq_parent(aq_inner(self)) wf_def = aq_parent(aq_inner(self))
if id == wf_def.state_var: if id == wf_def.state_var:
raise 'Bad Request', '"%s" is used for keeping state.' % id raise BadRequest('"%s" is used for keeping state.' % id)
return ContainerTab._checkId(self, id, allow_dup) return ContainerTab._checkId(self, id, allow_dup)
def getStateVar(self): def getStateVar(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