#35990: settings.TIME_INPUT_FORMATS never gets used since the removal of
USE_L10N
----------------------------------+--------------------------------------
Reporter: Arthur Pemberton | Type: Bug
Status: new | Component: Forms
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
`forms.TimeField` references `TIME_INPUT_FORMATS` via a call to
`django.utils.formats.get_format()`. However since the removal of
`settings.USE_L10N`(https://github.com/django/django/commit/8d98f99a4ab5de6f2c730399f53eba8bf6bea470)
if `get_format()` is called without its `use_l10n` parameter, it defaults
to `True`, as is the case with `forms.TimeField`. So locale specific
`TIME_INPUT_FORMATS` is always used.
This technically matches the documentation: "If no input_formats argument
is provided, the default input formats are taken from the active locale
format TIME_INPUT_FORMATS key, or from TIME_INPUT_FORMATS". However, the
implication is that `settings.TIME_INPUT_FORMATS` is used if you're not
using localization -- but it's no longer possible to turn off
localization.
Also, due to ticket:35986 the unittests covering this has likely not been
running.
--
Ticket URL: <https://code.djangoproject.com/ticket/35990>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070193ad8a25f0-9b256a44-0856-4e26-ac86-c33d35401b77-000000%40eu-central-1.amazonses.com.