OpenSlides/openslides/participant/middleware.py
Oskar Hahn 0752d476e4 Change to MIT Licence
* Remove headers
* Changed lineendings to linux style in AUTHORS and CHANGELOG
2013-11-04 14:57:30 +01:00

13 lines
449 B
Python

# -*- coding: utf-8 -*-
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):
request.user = request.user.user