Ben Bangert avatar Ben Bangert committed 0100359

* Fixed bug with Beaker not playing well with Registry when its placed above
it in the stack. Thanks Wichert Akkerman.

Comments (0)

Files changed (2)

 Beaker Changelog
 ================
 
+0.9.4 (**tip**)
+* Fixed bug with Beaker not playing well with Registry when its placed above
+  it in the stack. Thanks Wichert Akkerman.
+
 0.9.3 (2/28/2008)
 * Adding 'id' to cookie-based sessions for better compatibility.
 * Fixed error with exception still raised for PyCrypto missing.

beaker/middleware.py

     
     def __call__(self, environ, start_response):
         if environ.get('paste.registry'):
-            environ['paste.registry'].register(self.cache, self.cache_manager)
+            if environ['paste.registry'].reglist:
+                environ['paste.registry'].register(self.cache, self.cache_manager)
         environ[self.environ_key] = self.cache_manager
         return self.app(environ, start_response)
 
     def __call__(self, environ, start_response):
         session = SessionObject(environ, **self.options)
         if environ.get('paste.registry'):
-            environ['paste.registry'].register(self.session, session)
+            if environ['paste.registry'].reglist:
+                environ['paste.registry'].register(self.session, session)
         environ[self.environ_key] = session
         environ['beaker.get_session'] = self._get_session
         
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.