2012-08-12 10:12:26 +02:00
|
|
|
from django.contrib.auth.middleware import AuthenticationMiddleware as _AuthenticationMiddleware
|
|
|
|
from django.contrib.auth.models import AnonymousUser
|
|
|
|
|
|
|
|
|
|
|
|
class AuthenticationMiddleware(_AuthenticationMiddleware):
|
|
|
|
def process_request(self, request):
|
|
|
|
super(AuthenticationMiddleware, self).process_request(request)
|
|
|
|
|
|
|
|
if not isinstance(request.user, AnonymousUser):
|
2012-08-12 12:52:38 +02:00
|
|
|
request.user = request.user.user
|