X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/174c53e97bcf1e5412c141829d152aa5a2b8684c..22236fb67da2f27ceb35ad138f4d534a4fd08251:/forum/middleware/extended_user.py?ds=sidebyside diff --git a/forum/middleware/extended_user.py b/forum/middleware/extended_user.py index 0e44f73..dfe7163 100644 --- a/forum/middleware/extended_user.py +++ b/forum/middleware/extended_user.py @@ -2,6 +2,7 @@ from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth import logout from forum.models.user import AnonymousUser from forum.views.auth import forward_suspended_user +import logging class ExtendedUser(AuthenticationMiddleware): def process_request(self, request): @@ -16,8 +17,11 @@ class ExtendedUser(AuthenticationMiddleware): return forward_suspended_user(request, user) return None - except: - pass + except Exception, e: + import traceback + logging.error("Unable to convert auth_user %s to forum_user: \n%s" % ( + request.user.id, traceback.format_exc() + )) request.user = AnonymousUser() return None \ No newline at end of file