Commit c5228b57 authored by Jérome Perrin's avatar Jérome Perrin

use BadReques class rather than a string exception

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6860 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a14e7789
...@@ -20,6 +20,7 @@ from Products.ERP5Type.Utils import createExpressionContext ...@@ -20,6 +20,7 @@ from Products.ERP5Type.Utils import createExpressionContext
from Products.ERP5Type.ERP5Type import ERP5TypeInformation from Products.ERP5Type.ERP5Type import ERP5TypeInformation
from Products.CMFCore.Expression import Expression from Products.CMFCore.Expression import Expression
from Products.ERP5Type import _dtmldir from Products.ERP5Type import _dtmldir
from zExceptions import BadRequest
class ERP5PropertyManager(PropertyManager): class ERP5PropertyManager(PropertyManager):
""" """
...@@ -101,7 +102,7 @@ def PropertyManager_setProperty(self, id, value, type=None): ...@@ -101,7 +102,7 @@ def PropertyManager_setProperty(self, id, value, type=None):
self._wrapperCheck(value) self._wrapperCheck(value)
if not self.valid_property_id(id): if not self.valid_property_id(id):
raise 'Bad Request', 'Invalid or duplicate property id' raise BadRequest, 'Invalid or duplicate property id: %s' % id
if type in ('selection', 'multiple selection'): if type in ('selection', 'multiple selection'):
if not hasattr(self, value): if not hasattr(self, value):
......
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