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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 6 17:25:33 CEST 2006


Author: aurel
Date: Thu Apr  6 17:25:30 2006
New Revision: 6487

URL: http://svn.erp5.org?rev=6487&view=rev
Log:
don't fail if portal type not found when installing roles

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=6487&r1=6486&r2=6487&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Thu Apr  6 17:25:30 2006
@@ -1897,11 +1897,12 @@
           if action == 'nothing':
             continue
       path = 'portal_types/%s' % roles_path.split('/', 1)[1]
-      obj = p.unrestrictedTraverse(path)
-      setattr(obj, '_roles', []) # reset roles before applying
-      type_roles_list = self._objects[roles_path] or []
-      for type_role_property_dict in type_roles_list:
-        obj._roles.append(RoleInformation(**type_role_property_dict))
+      obj = p.unrestrictedTraverse(path, None)
+      if obj is not None:
+        setattr(obj, '_roles', []) # reset roles before applying
+        type_roles_list = self._objects[roles_path] or []
+        for type_role_property_dict in type_roles_list:
+          obj._roles.append(RoleInformation(**type_role_property_dict))
 
   def uninstall(self, context, **kw):
     p = context.getPortalObject()




More information about the Erp5-report mailing list