From 77d1e429ef1dc2da71540643d8482799c2e0bf6f Mon Sep 17 00:00:00 2001
From: Peter <peter.bobov@gmail.com>
Date: Tue, 27 Sep 2011 11:46:07 +0400
Subject: [PATCH] Fixes django.utils.format. Now it returns format.py values even if they are interpreted as False; e.g. 0 or ''.
---
django/utils/formats.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/django/utils/formats.py b/django/utils/formats.py
index 3babccb..e05351d 100644
a
|
b
|
def get_format(format_type, lang=None, use_l10n=None):
|
71 | 71 | lang = get_language() |
72 | 72 | cache_key = (format_type, lang) |
73 | 73 | try: |
74 | | return _format_cache[cache_key] or getattr(settings, format_type) |
| 74 | fc = _format_cache[cache_key] |
| 75 | return getattr(settings, format_type) if fc is None else fc |
75 | 76 | except KeyError: |
76 | 77 | for module in get_format_modules(lang): |
77 | 78 | try: |