From d2e67aea199e1c5e203b0939be901c54b9154b06 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Fri, 3 May 2019 10:20:31 -0400 Subject: [PATCH] Fix server error for in-flight migration --- awx/main/middleware.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/middleware.py b/awx/main/middleware.py index e2dcd9c1da..90f63fc1e2 100644 --- a/awx/main/middleware.py +++ b/awx/main/middleware.py @@ -127,6 +127,9 @@ class SessionTimeoutMiddleware(object): def process_response(self, request, response): 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. if request.session and not request.session.is_empty() and not should_skip: expiry = int(settings.SESSION_COOKIE_AGE)