]> git.openstreetmap.org Git - osqa.git/commitdiff
Adds logging statement to when there's an error converting auth_user to forum_user...
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 1 Jul 2010 19:03:58 +0000 (19:03 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 1 Jul 2010 19:03:58 +0000 (19:03 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@485 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/middleware/extended_user.py

index 0e44f736e2671b7cccf563e30c8ed54c1ec41e46..dfe71636fe3388c108fd7f0ff3894eecb2c3fc8b 100644 (file)
@@ -2,6 +2,7 @@ from django.contrib.auth.middleware import AuthenticationMiddleware
 from django.contrib.auth import logout\r
 from forum.models.user import AnonymousUser\r
 from forum.views.auth import forward_suspended_user\r
+import logging\r
 \r
 class ExtendedUser(AuthenticationMiddleware):\r
     def process_request(self, request):\r
@@ -16,8 +17,11 @@ class ExtendedUser(AuthenticationMiddleware):
                     return forward_suspended_user(request, user)\r
 \r
                 return None\r
-            except:\r
-                pass\r
+            except Exception, e:\r
+                import traceback\r
+                logging.error("Unable to convert auth_user %s to forum_user: \n%s" % (\r
+                    request.user.id, traceback.format_exc()\r
+                ))\r
 \r
         request.user = AnonymousUser()\r
         return None
\ No newline at end of file