Merge "Fix middleware to not access session fields without user auth"

This commit is contained in:
Jenkins 2013-08-14 17:08:38 +00:00 committed by Gerrit Code Review
commit 7e7965f875

View File

@ -46,6 +46,7 @@ class HorizonMiddleware(object):
def process_request(self, request): def process_request(self, request):
""" Adds data necessary for Horizon to function to the request. """ """ Adds data necessary for Horizon to function to the request. """
if hasattr(request, "user") and request.user.is_authenticated():
# Activate timezone handling # Activate timezone handling
tz = request.session.get('django_timezone') tz = request.session.get('django_timezone')
if tz: if tz: