From 4284b4cf4109b07ffb45f21ee4f4c37795e41468 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 28 Feb 2006 14:10:42 +0000
Subject: [PATCH] Catch appropriate exception raised by _getOb (AttributeError
 instead of KeyError)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5862 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/BusinessTemplate.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index edf3019d68..96771bd7bd 100755
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -1325,7 +1325,7 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
         try:
           portal_id = key.split('/')[-1]
           portal_type = pt._getOb(portal_id)
-        except KeyError:
+        except AttributeError:
           LOG("portal types not found : ", 100, portal_id)
           continue
         property_list = self._objects[key]
@@ -1350,7 +1350,7 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
       try:
         portal_id = key.split('/')[-1]
         portal_type = pt._getOb(portal_id)
-      except KeyError:
+      except AttributeError:
         LOG("portal types not found : ", 100, portal_id)
         continue
       property_list = self._objects[key]
-- 
2.30.9