From 2b339152d3f1eb14621c850ec1707b9cbcc5ac48 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Tue, 18 Dec 2007 09:17:32 +0000
Subject: [PATCH] Prevent infinitely trying to get portal_skins. This happens
 in very rare cases.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18379 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/patches/CMFCoreSkinnable.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/patches/CMFCoreSkinnable.py b/product/ERP5Type/patches/CMFCoreSkinnable.py
index a94b28568c..1628c6d940 100644
--- a/product/ERP5Type/patches/CMFCoreSkinnable.py
+++ b/product/ERP5Type/patches/CMFCoreSkinnable.py
@@ -69,8 +69,11 @@ def CMFCoreSkinnableSkinnableObjectManager___getattr__(self, name):
       try:
         return resolve[name]
       except KeyError:
-        if not ignore.has_key(name):
-          portal_skins = aq_base(self.portal_skins)
+        if not ignore.has_key(name) and name != 'portal_skins':
+          try:
+            portal_skins = aq_base(self.portal_skins)
+          except AttributeError:
+            raise AttributeError, name
           try:
             skin_selection_mapping = portal_skins._v_skin_location_list
           except AttributeError:
-- 
2.30.9