mirror of
https://github.com/django/django.git
synced 2025-06-16 08:59:17 +00:00
Made translation maps consistent in NullBooleanSelect widget
`format_value` should be consistent with `value_from_datadict` method. Translation map options "True" and "False" were missing from the `format_value` method. This change ensures consistency of use between the methods, as well as practical passing of "True" value to the widget when rendering.
This commit is contained in:
parent
adae619426
commit
03e194e647
@ -808,6 +808,8 @@ class NullBooleanSelect(Select):
|
|||||||
return {
|
return {
|
||||||
True: "true",
|
True: "true",
|
||||||
False: "false",
|
False: "false",
|
||||||
|
"True": "true",
|
||||||
|
"False": "false",
|
||||||
"true": "true",
|
"true": "true",
|
||||||
"false": "false",
|
"false": "false",
|
||||||
# For backwards compatibility with Django < 2.2.
|
# For backwards compatibility with Django < 2.2.
|
||||||
@ -821,9 +823,9 @@ class NullBooleanSelect(Select):
|
|||||||
value = data.get(name)
|
value = data.get(name)
|
||||||
return {
|
return {
|
||||||
True: True,
|
True: True,
|
||||||
|
False: False,
|
||||||
"True": True,
|
"True": True,
|
||||||
"False": False,
|
"False": False,
|
||||||
False: False,
|
|
||||||
"true": True,
|
"true": True,
|
||||||
"false": False,
|
"false": False,
|
||||||
# For backwards compatibility with Django < 2.2.
|
# For backwards compatibility with Django < 2.2.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user