]> asedeno.scripts.mit.edu Git - bluechips.git/commitdiff
Make noauth actually work.
authorEvan Broder <broder@mit.edu>
Thu, 1 Jul 2010 01:53:10 +0000 (21:53 -0400)
committerEvan Broder <broder@mit.edu>
Thu, 1 Jul 2010 01:53:10 +0000 (21:53 -0400)
bluechips/config/middleware.py

index e52eb3a8a5f59067fd6476205a9de3ec7d69267f..15983584c3f48bd61d5ca12d94417fe64a18155d 100644 (file)
@@ -42,7 +42,7 @@ def make_app(global_conf, full_stack=True, **app_conf):
     app = PylonsApp()
     
     # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
-    if not app_conf.get('noauth', False):
+    if not asbool(app_conf.get('noauth')):
         app = authkit.authorize.middleware(app, BlueChipUser())
     
     # Routing/Session/Cache Middleware
@@ -68,6 +68,7 @@ def make_app(global_conf, full_stack=True, **app_conf):
     # server is handling this static content, remove the following 3 lines)
     static_app = StaticURLParser(config['pylons.paths']['static_files'])
     app = Cascade([static_app, app])
-    app = AuthBasicHandler(app, 'BlueChips', authenticate)
-    app = DummyAuthenticate(app, app_conf)
+    if not asbool(app_conf.get('noauth')):
+        app = AuthBasicHandler(app, 'BlueChips', authenticate)
+        app = DummyAuthenticate(app, app_conf)
     return app