--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -69,8 +69,11 @@ def get_format(format_type, lang=None, use_l10n=None):
             lang = get_language()
         cache_key = (format_type, lang)
         try:
-            return _format_cache[cache_key] or getattr(settings, format_type)
-        except KeyError:
+            try:
+                return _format_cache[cache_key]
+            except KeyError:
+                return getattr(settings, format_type)
+        except AttributeError:
             for module in get_format_modules():
                 try:
                     val = getattr(module, format_type)

