#22654: DecimalField and DECIMAL_SEPARATOR (in admin)
--------------------------+-----------------------------------------
     Reporter:  matija@…  |                    Owner:
         Type:  Bug       |                   Status:  new
    Component:  Forms     |                  Version:  1.6
     Severity:  Normal    |               Resolution:
     Keywords:            |             Triage Stage:  Someday/Maybe
    Has patch:  0         |      Needs documentation:  0
  Needs tests:  0         |  Patch needs improvement:  0
Easy pickings:  0         |                    UI/UX:  0
--------------------------+-----------------------------------------

Comment (by anonymous):

 Sure. With settings above, everything works as excpected, comma is shown,
 but when I try to save, ValidationError is shown.
 Error is, of course, in croatian, but it comes back to this:

 invalid': _('Enter a number.'),
 https://github.com/django/django/blob/master/django/forms/fields.py

 If L10N is set tu True, everything actually works. The problem is in this
 line. When self.localize is set to true, this works fine, but this should
 be run when localization is off, but DECIMAL_SEPARATOR is anything other
 than '.'. Would anything break if this "if" is simple removed?

 if self.localize:
     value = formats.sanitize_separators(value)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22654#comment:6>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/077.02c47574a9f5481dc4e4accd63ae3823%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to