Log message for revision 72251:
  - made sure we can set up the skin *before* the site manager (maybe we 
can/should set it up *after* the sm?)

Changed:
  U   CMF/branches/jens_tools_as_utilities/CMFCore/Skinnable.py

-=-
Modified: CMF/branches/jens_tools_as_utilities/CMFCore/Skinnable.py
===================================================================
--- CMF/branches/jens_tools_as_utilities/CMFCore/Skinnable.py   2007-01-29 
16:42:04 UTC (rev 72250)
+++ CMF/branches/jens_tools_as_utilities/CMFCore/Skinnable.py   2007-01-29 
17:55:53 UTC (rev 72251)
@@ -21,6 +21,7 @@
 import logging
 from thread import get_ident
 from warnings import warn
+from zope.component import getSiteManager
 
 from AccessControl import ClassSecurityInfo
 from Acquisition import aq_base
@@ -107,6 +108,11 @@
         """
         skinob = None
         sf = queryUtility(ISkinsTool)
+        if sf is None:
+            # XXX: Maybe we can set up the skin *after* the sm?
+            # try again with self as explicit site
+            sm = getSiteManager(self)
+            sf = sm.queryUtility(ISkinsTool)
 
         if sf is not None:
            if name is not None:
@@ -122,6 +128,11 @@
     def getSkinNameFromRequest(self, REQUEST=None):
         '''Returns the skin name from the Request.'''
         sf = queryUtility(ISkinsTool)
+        if sf is None:
+            # XXX: Maybe we can set up the skin *after* the sm?
+            # try again with self as explicit site
+            sm = getSiteManager(self)
+            sf = sm.queryUtility(ISkinsTool)
         if sf is not None:
             return REQUEST.get(sf.getRequestVarname(), None)
 

_______________________________________________
CMF-checkins mailing list
[email protected]
http://mail.zope.org/mailman/listinfo/cmf-checkins

Reply via email to