1 from django.contrib.auth.middleware import AuthenticationMiddleware
\r
2 from forum.models.user import AnonymousUser
\r
4 class ExtendedUser(AuthenticationMiddleware):
\r
5 def process_request(self, request):
\r
6 super(ExtendedUser, self).process_request(request)
\r
7 if request.user.is_authenticated():
\r
9 request.user = request.user.user
\r
14 request.user = AnonymousUser()
\r