diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-04 13:52:36 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-02-04 13:52:36 +0000 |
| commit | d44fb0557a0a9d8fab62b1e48078be498c61287a (patch) | |
| tree | e66730375c4751b8be5c65835f28c0271e721be3 /django/utils/formats.py | |
| parent | 987fd511769a3e1342fe8678a0b183f2831adb60 (diff) | |
Fixed #14824 -- Corrected the handling of formats when USE_L10N is disabled. Thanks to nullie for the report and initial patch, and to idle for the separate report with helpful debug info.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15404 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/formats.py')
| -rw-r--r-- | django/utils/formats.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/django/utils/formats.py b/django/utils/formats.py index 3c43f52f2f..0dc23402f2 100644 --- a/django/utils/formats.py +++ b/django/utils/formats.py @@ -14,11 +14,21 @@ from django.utils.safestring import mark_safe _format_cache = {} _format_modules_cache = {} +def reset_format_cache(): + """Clear any cached formats. + + This method is provided primarily for testing purposes, + so that the effects of cached formats can be removed. + """ + global _format_cache, _format_modules_cache + _format_cache = {} + _format_modules_cache = {} + def iter_format_modules(lang): """ Does the heavy lifting of finding format modules. """ - if check_for_language(lang) or settings.USE_L10N: + if check_for_language(lang): format_locations = ['django.conf.locale.%s'] if settings.FORMAT_MODULE_PATH: format_locations.append(settings.FORMAT_MODULE_PATH + '.%s') |
