Merge "Properly set session value for services_region"

This commit is contained in:
Zuul 2024-02-20 13:07:34 +00:00 committed by Gerrit Code Review
commit 2b03b44f3a

View File

@ -192,6 +192,10 @@ def login(request):
region_name = regions.get(login_region)
request.session['region_endpoint'] = region
request.session['region_name'] = region_name
# Check for a services_region cookie. Fall back to the login_region.
services_region = request.COOKIES.get('services_region', region_name)
if services_region in request.user.available_services_regions:
request.session['services_region'] = services_region
expiration_time = request.user.time_until_expiration()
threshold_days = settings.PASSWORD_EXPIRES_WARNING_THRESHOLD_DAYS
if (expiration_time is not None and