[Checkins] SVN: Zope/branches/haufe-legacy-integration/ - Launchpad #373658: traversal using (un)restrictedTraverse

Andreas Jung andreas at andreas-jung.com
Sun May 10 15:12:43 EDT 2009


Log message for revision 99829:
  
  - Launchpad #373658: traversal using (un)restrictedTraverse 
    no longer depends no the existence of a request 
  
  

Changed:
  U   Zope/branches/haufe-legacy-integration/doc/CHANGES.rst
  U   Zope/branches/haufe-legacy-integration/src/OFS/Traversable.py

-=-
Modified: Zope/branches/haufe-legacy-integration/doc/CHANGES.rst
===================================================================
--- Zope/branches/haufe-legacy-integration/doc/CHANGES.rst	2009-05-10 16:14:42 UTC (rev 99828)
+++ Zope/branches/haufe-legacy-integration/doc/CHANGES.rst	2009-05-10 19:12:43 UTC (rev 99829)
@@ -23,6 +23,9 @@
 Features Added
 ++++++++++++++
 
+- Launchpad #373658: traversal using (un)restrictedTraverse 
+  no longer depends no the existence of a request 
+
 - Launchpad #373583: ZODBMountPoint - fixed broken mount support and 
   extended the test suite.
 

Modified: Zope/branches/haufe-legacy-integration/src/OFS/Traversable.py
===================================================================
--- Zope/branches/haufe-legacy-integration/src/OFS/Traversable.py	2009-05-10 16:14:42 UTC (rev 99828)
+++ Zope/branches/haufe-legacy-integration/src/OFS/Traversable.py	2009-05-10 19:12:43 UTC (rev 99829)
@@ -154,6 +154,7 @@
             path = list(path)
 
         REQUEST = {'TraversalRequestNameStack': path}
+        web_request = getattr(self, 'REQUEST', None)
         path.reverse()
         path_pop = path.pop
 
@@ -198,7 +199,7 @@
                         ns, nm = nsParse(name)
                         try:
                             next = namespaceLookup(
-                                ns, nm, obj, aq_acquire(self, 'REQUEST'))
+                                ns, nm, obj, web_request).__of__(obj)
                             if IAcquirer.providedBy(next):
                                 next = next.__of__(obj)
                             if restricted and not validate(
@@ -264,7 +265,7 @@
 
                 except (AttributeError, NotFound, KeyError), e:
                     # Try to look for a view
-                    next = queryMultiAdapter((obj, aq_acquire(self, 'REQUEST')),
+                    next = queryMultiAdapter((obj, web_request),
                                              Interface, name)
 
                     if next is not None:



More information about the Checkins mailing list