Commit 01dcb768 authored by Christophe Dumez's avatar Christophe Dumez

- Changed the name of the exception before I couldn't catch the old one in unit tests


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9019 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81bfdb37
...@@ -88,16 +88,6 @@ catalog_method_filter_list = ('_filter_expression_archive', ...@@ -88,16 +88,6 @@ catalog_method_filter_list = ('_filter_expression_archive',
'_filter_expression_instance_archive', '_filter_expression_instance_archive',
'_filter_type_archive',) '_filter_type_archive',)
class BusinessTemplateMissingDependency(Exception):
""" Exception raised when a dependency is missing
"""
pass
class BusinessTemplateResolveError(Exception):
""" Exception raised when a dependency is missing
"""
pass
def removeAll(entry): def removeAll(entry):
''' '''
Remove all files and directories under 'entry'. Remove all files and directories under 'entry'.
...@@ -298,8 +288,8 @@ class BusinessTemplateTarball(BusinessTemplateArchive): ...@@ -298,8 +288,8 @@ class BusinessTemplateTarball(BusinessTemplateArchive):
io.close() io.close()
class TemplateConditionError(Exception): pass class TemplateConditionError(Exception): pass
class TemplateConflictError(Exception): pass class TemplateConflictError(Exception): pass
class BusinessTemplateMissingDependency(Exception): pass
class BaseTemplateItem(Implicit, Persistent): class BaseTemplateItem(Implicit, Persistent):
""" """
...@@ -749,10 +739,9 @@ class PathTemplateItem(ObjectTemplateItem): ...@@ -749,10 +739,9 @@ class PathTemplateItem(ObjectTemplateItem):
id = id_list[0] id = id_list[0]
if re.search('[\*\?\[\]]', id) is None: if re.search('[\*\?\[\]]', id) is None:
# If the id has no meta character, do not have to check all objects. # If the id has no meta character, do not have to check all objects.
try: obj = folder._getOb(id, None)
obj = folder._getOb(id) if obj is None:
except AttributeError: raise AttributeError, "Could not resolve '%s' during business template processing." % id
raise BusinessTemplateResolveError, "Could not resolve '%s' during business template processing." % id
return self._resolvePath(obj, relative_url_list + [id], id_list[1:]) return self._resolvePath(obj, relative_url_list + [id], id_list[1:])
path_list = [] path_list = []
for object_id in fnmatch.filter(folder.objectIds(), id): for object_id in fnmatch.filter(folder.objectIds(), id):
......
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