mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 00:08:44 -03:30
Fix server error for in-flight migration
This commit is contained in:
@@ -127,6 +127,9 @@ class SessionTimeoutMiddleware(object):
|
|||||||
|
|
||||||
def process_response(self, request, response):
|
def process_response(self, request, response):
|
||||||
should_skip = 'HTTP_X_WS_SESSION_QUIET' in request.META
|
should_skip = 'HTTP_X_WS_SESSION_QUIET' in request.META
|
||||||
|
# Something went wrong, such as upgrade-in-progress page
|
||||||
|
if not hasattr(request, 'session'):
|
||||||
|
return response
|
||||||
# Only update the session if it hasn't been flushed by being forced to log out.
|
# Only update the session if it hasn't been flushed by being forced to log out.
|
||||||
if request.session and not request.session.is_empty() and not should_skip:
|
if request.session and not request.session.is_empty() and not should_skip:
|
||||||
expiry = int(settings.SESSION_COOKIE_AGE)
|
expiry = int(settings.SESSION_COOKIE_AGE)
|
||||||
|
|||||||
Reference in New Issue
Block a user