Skip to content

Commit ece488b

Browse files
Removed persistence of preferred language in session during logout. (#1617)
Since Django 2.1 language is stored in settings.LANGUAGE_COOKIE_NAME. Legacy support for handling it in the session is removed in Django 4.0.
1 parent c371152 commit ece488b

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

channels/auth.py

-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from django.contrib.auth.models import AnonymousUser
1313
from django.utils.crypto import constant_time_compare
1414
from django.utils.functional import LazyObject
15-
from django.utils.translation import LANGUAGE_SESSION_KEY
1615

1716
from channels.db import database_sync_to_async
1817
from channels.middleware import BaseMiddleware
@@ -126,11 +125,7 @@ def logout(scope):
126125
user = None
127126
if user is not None:
128127
user_logged_out.send(sender=user.__class__, request=None, user=user)
129-
# remember language choice saved to session
130-
language = session.get(LANGUAGE_SESSION_KEY)
131128
session.flush()
132-
if language is not None:
133-
session[LANGUAGE_SESSION_KEY] = language
134129
if "user" in scope:
135130
scope["user"] = AnonymousUser()
136131

0 commit comments

Comments
 (0)