--
Ticket URL: <https://code.djangoproject.com/ticket/28562>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Bug
* version: 1.11 => master
* component: Uncategorized => Core (Other)
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:1>
* owner: nobody => Josh Schneier
* status: new => assigned
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/9015 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:2>
* cc: Tim Martin (added)
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"e8c45963296eb8bf3938bf9ece30b585a8cbb097" e8c45963]:
{{{
#!CommitTicketReference repository=""
revision="e8c45963296eb8bf3938bf9ece30b585a8cbb097"
Fixed #28562 -- Fixed DecimalValidator handling of positive exponent
scientific notation.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7c6590af5f199c9ede970758877b5c1eb7e9b3a6" 7c6590af]:
{{{
#!CommitTicketReference repository=""
revision="7c6590af5f199c9ede970758877b5c1eb7e9b3a6"
[2.0.x] Fixed #28562 -- Fixed DecimalValidator handling of positive
exponent scientific notation.
Backport of e8c45963296eb8bf3938bf9ece30b585a8cbb097 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:5>
* status: closed => new
* resolution: fixed =>
Comment:
Running version Django==2.0.1
With Example form
{{{
class UpdateBalanceForm(forms.Form):
id = forms.ModelChoiceField(ProductPortfolio.objects.all(),
required=True)
balance = forms.DecimalField(decimal_places=2, max_digits=16,
required=True)
}}}
Running the following you get
{{{
form = UpdateBalanceForm({'id':1,
'balance':Decimal('5.420575188741E-12')})
form.is_valid()
False
form.errors
{'id': ['Select a valid choice. That choice is not one of the available
choices.'], 'balance': ['Ensure that there are no more than 16 digits in
total.']}
}}}
This is surprising because the value has 13 digits minus the scientific
notation
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
Please open a new ticket as the fix for this ticket has been released.
--
Ticket URL: <https://code.djangoproject.com/ticket/28562#comment:7>