[Erp5-report] r9019 - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 3 14:13:38 CEST 2006


Author: chris
Date: Thu Aug  3 14:13:36 2006
New Revision: 9019

URL: http://svn.erp5.org?rev=9019&view=rev
Log:
- Changed the name of the exception before I couldn't catch the old one in unit tests

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=9019&r1=9018&r2=9019&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Thu Aug  3 14:13:36 2006
@@ -87,16 +87,6 @@
 catalog_method_filter_list = ('_filter_expression_archive',
                               '_filter_expression_instance_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):
   '''
@@ -298,8 +288,8 @@
     io.close()
 
 class TemplateConditionError(Exception): pass
-
 class TemplateConflictError(Exception): pass
+class BusinessTemplateMissingDependency(Exception): pass
 
 class BaseTemplateItem(Implicit, Persistent):
   """
@@ -749,10 +739,9 @@
     id = id_list[0]
     if re.search('[\*\?\[\]]', id) is None:
       # If the id has no meta character, do not have to check all objects.
-      try:
-        obj = folder._getOb(id)
-      except AttributeError:
-        raise BusinessTemplateResolveError, "Could not resolve '%s' during business template processing." % id
+      obj = folder._getOb(id, None)
+      if obj is None:
+        raise AttributeError, "Could not resolve '%s' during business template processing." % id
       return self._resolvePath(obj, relative_url_list + [id], id_list[1:])
     path_list = []
     for object_id in fnmatch.filter(folder.objectIds(), id):




More information about the Erp5-report mailing list