summaryrefslogtreecommitdiff
path: root/django/utils/cache.py
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2018-03-04 00:56:39 +0500
committerTim Graham <timograham@gmail.com>2018-03-03 14:56:39 -0500
commit4ff29a53e68ef44b2f4947548a224b569d4b0394 (patch)
treeb520726c3052f35dc5940ac877bfdc1ec7390222 /django/utils/cache.py
parent683341db4396d92e4578d348b7fcce3312df505d (diff)
downloaddjango-4ff29a53e68ef44b2f4947548a224b569d4b0394.tar.gz
Refs #17476 -- Removed obsolete simplification of timezone names in cache key generation.
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r--django/utils/cache.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index 86234f7aed..7117d40526 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -24,7 +24,7 @@ import time
from django.conf import settings
from django.core.cache import caches
from django.http import HttpResponse, HttpResponseNotModified
-from django.utils.encoding import force_bytes, force_text, iri_to_uri
+from django.utils.encoding import force_bytes, iri_to_uri
from django.utils.http import (
http_date, parse_etags, parse_http_date_safe, quote_etag,
)
@@ -295,12 +295,7 @@ def _i18n_cache_key_suffix(request, cache_key):
# which in turn can also fall back to settings.LANGUAGE_CODE
cache_key += '.%s' % getattr(request, 'LANGUAGE_CODE', get_language())
if settings.USE_TZ:
- # The datetime module doesn't restrict the output of tzname().
- # Windows is known to use non-standard, locale-dependent names.
- # User-defined tzinfo classes may return absolutely anything.
- # Hence this paranoid conversion to create a valid cache key.
- tz_name = force_text(get_current_timezone_name(), errors='ignore')
- cache_key += '.%s' % tz_name.encode('ascii', 'ignore').decode('ascii').replace(' ', '_')
+ cache_key += '.%s' % get_current_timezone_name()
return cache_key