Merge pull request #3543 from AlanCoding/migration_schmigration

Fix server error for in-flight migration
This commit is contained in:
Ryan Petrello
2019-05-03 11:59:02 -04:00
committed by GitHub

View File

@@ -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)