Merge "Fix AttributeError on Ajax calls with expired session"

This commit is contained in:
Jenkins 2013-11-12 18:28:04 +00:00 committed by Gerrit Code Review
commit 7179d7c06c
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ class HorizonMiddleware(object):
Convert HttpResponseRedirect to HttpResponse if request is via ajax
to allow ajax request to redirect url
"""
if request.is_ajax():
if request.is_ajax() and hasattr(request, 'horizon'):
queued_msgs = request.horizon['async_messages']
if type(response) == http.HttpResponseRedirect:
# Drop our messages back into the session as per usual so they