1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #28795 -- Removed 'not in' checks and used dict.setdefault().

This commit is contained in:
Дилян Палаузов
2017-11-13 16:15:49 -05:00
committed by Tim Graham
parent a2ec1e6b2d
commit 23bf4ad87f
13 changed files with 27 additions and 60 deletions

View File

@@ -57,6 +57,5 @@ class LocaleMiddleware(MiddlewareMixin):
if not (i18n_patterns_used and language_from_path):
patch_vary_headers(response, ('Accept-Language',))
if 'Content-Language' not in response:
response['Content-Language'] = language
response.setdefault('Content-Language', language)
return response