Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal separator is incorrectly managed by the browsable API #3139

Closed
dispiste opened this issue Jul 11, 2015 · 1 comment
Closed

Decimal separator is incorrectly managed by the browsable API #3139

dispiste opened this issue Jul 11, 2015 · 1 comment
Labels
Milestone

Comments

@dispiste
Copy link

I have a model containing FloatField field:

coste = models.FloatField(null=True, blank=True)

and I have built a browsable API for the model using djangorestframework.

In the put form of the browsable API, the coste field is automatically formatted using a comma separator (so 3.0 is shown in the form as 3,0). I guess django or djangorestframework are formatting it according to my system locale.

However, if the form is submitted an error because of the number formatting:
HTTP 400 Bad Request

{
    "coste": [
        "Se requiere un número válido. [means: A valid number is required]"
    ]
}

I am aware that djangorestframework does not support localized decimal fields (according to #2897), but I would expect that it is able to create a non-localized field which correctly works on a localized environment.

@tomchristie tomchristie added this to the 3.1.4 Release milestone Jul 14, 2015
@tomchristie
Copy link
Member

Now resolved in master - thanks for the report!

@tomchristie tomchristie modified the milestones: 3.1.4 Release, 3.2.0 Release Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants