#15918: settings.THOUSAND_SEPARATOR is ignored on output
-------------------------------------+-------------------------------------
               Reporter:  lev        |          Owner:  nobody
                   Type:  Bug        |         Status:  reopened
              Milestone:             |      Component:
                Version:  1.3        |  Internationalization
             Resolution:             |       Severity:  Normal
           Triage Stage:             |       Keywords:  THOUSAND_SEPARATOR
  Unreviewed                         |      Has patch:  1
    Needs documentation:  0          |    Needs tests:  1
Patch needs improvement:  0          |  Easy pickings:  1
-------------------------------------+-------------------------------------
Changes (by lev):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Docstring doesn't state that settings.THOUSAND_SEPARATOR take precedence
 over locale. Neither does the documentation. And if you look into the
 code, the intention is that settings.<WHATEVER> should take precedence
 over the locale:

 {{{
 try:
    return _format_cache[cache_key] or getattr(settings, format_type)
 except KeyError:
    <take from conf/locale>
 }}}

 But the problem is that it never takes format_type from settings.

 Because if the value is not cached yet, it throws KeyError, and if it is
 cached (from conf/locale), it is taken from cache.

 It should be something like

 {{{
 try:
    return _format_cache.get('cache_key', '') or getattr(settings,
 format_type)
 except KeyError:
    <take from conf/locale>
 }}}

 A cleaner variant is suggested in a patch (which deals better with Nones
 and empty strings).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15918#comment:2>
Django <http://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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to