From f5d4b45df106ad3d37783ef8ea424c030bb6b196 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 10 May 2014 18:40:44 +0200 Subject: Fixed #21634 -- Prevented hiding ImproperlyConfigured when command not found Thanks nikolay.v.golub@gmail.com for the report. --- django/core/management/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'django') 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) -- cgit v1.3