diff options
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r-- | django/utils/cache.py | 9 |
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 |