From 9f3b092034f7a00562c50710d636a394823cf9f9 Mon Sep 17 00:00:00 2001 From: Sergei Kliuikov Date: Fri, 31 May 2024 21:11:36 -0700 Subject: [PATCH] 5.9.3 ### Changelog: * HotFix(backend): Set lang cookie only if it changed. --- vstutils/__init__.py | 2 +- vstutils/middleware.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vstutils/__init__.py b/vstutils/__init__.py index 652f10fc..d69c3e52 100644 --- a/vstutils/__init__.py +++ b/vstutils/__init__.py @@ -1,2 +1,2 @@ # pylint: disable=django-not-available -__version__: str = '5.9.3' +__version__: str = '5.9.4' diff --git a/vstutils/middleware.py b/vstutils/middleware.py index bb42b7b7..15d41115 100644 --- a/vstutils/middleware.py +++ b/vstutils/middleware.py @@ -213,6 +213,7 @@ def get_lang_object(self, request): set_cookie = True if 'lang' in request.GET: code = request.GET['lang'] + set_cookie = request.COOKIES.get('settings.LANGUAGE_COOKIE_NAME') != code elif settings.LANGUAGE_COOKIE_NAME in request.COOKIES: code = request.COOKIES[settings.LANGUAGE_COOKIE_NAME] set_cookie = False