mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #26281 -- Added a helpful error message for an invalid format specifier to dateformat.format().
This commit is contained in:
@@ -767,10 +767,10 @@ def time(value, arg=None):
|
||||
return ''
|
||||
try:
|
||||
return formats.time_format(value, arg)
|
||||
except AttributeError:
|
||||
except (AttributeError, TypeError):
|
||||
try:
|
||||
return time_format(value, arg)
|
||||
except AttributeError:
|
||||
except (AttributeError, TypeError):
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user