Opened 9 years ago
Closed 9 years ago
#26173 closed Bug (fixed)
localize_input() shouldn't put thousands separator in boolean values
Reported by: | Marcin Markiewicz | Owned by: | Marcin Markiewicz |
---|---|---|---|
Component: | Utilities | Version: | |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
django.utils.formats localize_input inserts thousands_separator into boolean values
The problem is in django.utils.formats localize_input that is used in widgets to render value
There is a check there like so:
if isinstance(value, (decimal.Decimal, float, int, long)):
which evaluates to True for Booleans (because booleans are ints, see "issubclass(bool, int)")
This was reported: https://code.djangoproject.com/ticket/14807
but this is old closed history.
It touched us again, so maybe this time will be better to solve this
Attachments (1)
Change History (5)
by , 9 years ago
Attachment: | 26173-test.diff added |
---|
comment:1 by , 9 years ago
Component: | Forms → Utilities |
---|---|
Easy pickings: | set |
Has patch: | unset |
Summary: | Don't localize boolean values → localize_input() shouldn't put thousands separator in boolean values |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
comment:2 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 9 years ago
I make pull request with this change
https://github.com/django/django/pull/6080
I've attached a regression test. That just needs to be combined with the fix and sent as a pull request.