[Checkins] SVN: five.localsitemanager/trunk/src/five/localsitemanager/registry.py If no current site can be found (which should only happen in tests that forget to call setSite), return utilities wrapped in the site they where registered in.

Hanno Schlichting plone at hannosch.info
Wed Jun 6 17:33:29 EDT 2007


Log message for revision 76442:
  If no current site can be found (which should only happen in tests that forget to call setSite), return utilities wrapped in the site they where registered in.
  

Changed:
  U   five.localsitemanager/trunk/src/five/localsitemanager/registry.py

-=-
Modified: five.localsitemanager/trunk/src/five/localsitemanager/registry.py
===================================================================
--- five.localsitemanager/trunk/src/five/localsitemanager/registry.py	2007-06-06 17:56:44 UTC (rev 76441)
+++ five.localsitemanager/trunk/src/five/localsitemanager/registry.py	2007-06-06 21:33:29 UTC (rev 76442)
@@ -117,6 +117,12 @@
         if not ISite.providedBy(registry_site):
             registry_site = registry_site.__parent__
 
+        if current_site is None:
+            # If no current site can be found, return utilities wrapped in
+            # the site they where registered in. We loose the whole aq chain
+            # here though
+            current_site = Acquisition.aq_base(registry_site)
+
         parent = None
 
         if current_site == registry_site:



More information about the Checkins mailing list