Opened 14 years ago
Closed 14 years ago
#16938 closed Bug (fixed)
django.utils.formats.get_format skips values interpreted as false
| Reported by: | Peter Bobov | Owned by: | nobody |
|---|---|---|---|
| Component: | Internationalization | Version: | 1.3 |
| Severity: | Normal | Keywords: | utils get_format |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Here
return _format_cache[cache_key] or getattr(settings, format_type)
it tries to evaluate getattr if _format_cache[cache_key] interprets as false.
Thereby if user sets some value in <LOCALE>/formats.py to the value interpreted by Python as False, then Django skips returning it.
For example,
if I set <SOME_LOCALE>/formats.py's THOUSAND_SEPARATOR to '' Django takes value from django.conf.settings instead of formats.py.
Attachments (2)
Change History (4)
by , 14 years ago
| Attachment: | fix_format_false_interpretation.patch added |
|---|
comment:1 by , 14 years ago
| Component: | Uncategorized → Internationalization |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
by , 14 years ago
| Attachment: | 16938.empty-string-locale-format.diff added |
|---|
Note:
See TracTickets
for help on using tickets.
small patch