fixed a bug that was deleting the messages
authorRodney Ewing <ewing.rj@gmail.com>
Tue, 4 Jun 2013 18:26:34 +0000 (11:26 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Tue, 4 Jun 2013 18:30:56 +0000 (11:30 -0700)
mediagoblin/app.py
mediagoblin/auth/tools.py

index ecd3de0e677331f56908cabd01c4c1c1d4009887..575a38357bebd0df04d34d8b01c3b79b8b7740b2 100644 (file)
@@ -192,11 +192,11 @@ class MediaGoblinApp(object):
 
         request.urlgen = build_proxy
 
-        mg_request.setup_user_in_request(request)
-
         # Log user out if in no_auth mode
         no_auth_logout(request)
 
+        mg_request.setup_user_in_request(request)
+
         request.controller_name = None
         try:
             found_rule, url_values = map_adapter.match(return_rule=True)
index 22da54d070cd045ebfa94e32def4d828a091323f..ae0b79da722ce84779937ce038290b6fc4ca3b7e 100644 (file)
@@ -202,6 +202,7 @@ def check_auth_enabled():
 
 
 def no_auth_logout(request):
-    """Log out the user if in no_auth mode"""
-    if not mg_globals.app.auth:
-        request.session.delete()
+    """Log out the user if in no_auth mode, but don't delete the messages"""
+    if not mg_globals.app.auth and 'user_id' in request.session:
+        del request.session['user_id']
+        request.session.save()