1
0
mirror of https://github.com/django/django.git synced 2025-10-31 01:25:32 +00:00

Simplified django.utils.formats.date_format()/time_format() calls.

This removes redundant get_format() calls and passing a default value
for the format argument.
This commit is contained in:
Nick Pope
2022-10-12 13:23:04 +01:00
committed by Mariusz Felisiak
parent 5cf9ff970e
commit 0fdc5d79b6
2 changed files with 7 additions and 20 deletions

View File

@@ -217,7 +217,7 @@ def localize(value, use_l10n=None):
elif isinstance(value, datetime.date):
return date_format(value, use_l10n=use_l10n)
elif isinstance(value, datetime.time):
return time_format(value, "TIME_FORMAT", use_l10n=use_l10n)
return time_format(value, use_l10n=use_l10n)
return value