Commits

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