summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2022-05-28 11:52:06 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-05-31 06:09:39 +0200
commit292f372768836e2aebc713064c5139e8067eebcb (patch)
tree2f95fd95d27e18bc35f2d9378172cca97ee1935c /django/utils
parent8c0886b068ba4e224dd78104b93c9638b860b398 (diff)
Fixed #33748 -- Fixed date template filter crash with lazy format.
Regression in 659d2421c7adbbcd205604002d521d82d6b0b465.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/formats.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/utils/formats.py b/django/utils/formats.py
index 3f38322d84..b0a66e4e25 100644
--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -113,6 +113,7 @@ def get_format(format_type, lang=None, use_l10n=None):
use_l10n = settings.USE_L10N
if use_l10n and lang is None:
lang = get_language()
+ format_type = str(format_type) # format_type may be lazy.
cache_key = (format_type, lang)
try:
return _format_cache[cache_key]