summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-05-10 18:40:44 +0200
committerErik Romijn <eromijn@solidlinks.nl>2014-05-16 12:08:31 +0200
commitf5d4b45df106ad3d37783ef8ea424c030bb6b196 (patch)
tree9a79e3939b4abf6747bb96e71d913dc6bb574d19 /django/core
parentcb15231888df2545356ad307eaea07f36aa0e8e0 (diff)
Fixed #21634 -- Prevented hiding ImproperlyConfigured when command not found
Thanks nikolay.v.golub@gmail.com for the report.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index b6a7d53a0c..fdbf5c26eb 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -262,10 +262,10 @@ class ManagementUtility(object):
# Output an extra note if settings are not properly configured
try:
settings.INSTALLED_APPS
- except ImproperlyConfigured as e:
+ except ImproperlyConfigured as err:
usage.append(style.NOTICE(
"Note that only Django core commands are listed as settings "
- "are not properly configured (error: %s)." % e))
+ "are not properly configured (error: %s)." % err))
return '\n'.join(usage)
@@ -280,6 +280,8 @@ class ManagementUtility(object):
try:
app_name = commands[subcommand]
except KeyError:
+ # This might trigger ImproperlyConfigured (masked in get_commands)
+ settings.INSTALLED_APPS
sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" %
(subcommand, self.prog_name))
sys.exit(1)