1
0
mirror of https://github.com/django/django.git synced 2025-04-19 06:44:36 +00:00

remove unnecessary call to settings.INSTALLED_APPS

This commit is contained in:
Ben Cail 2024-11-13 13:57:29 -05:00
parent 894b227d29
commit e2b4c14281

View File

@ -254,16 +254,9 @@ class ManagementUtility:
try:
app_name = commands[subcommand]
except KeyError:
if os.environ.get("DJANGO_SETTINGS_MODULE"):
if self.settings_exception:
sys.stderr.write(str(self.settings_exception) + "\n")
sys.exit(1)
else:
# If `subcommand` is missing due to misconfigured settings, the
# following line will retrigger an ImproperlyConfigured exception
# (get_commands() swallows the original one) so the user is
# informed about it.
settings.INSTALLED_APPS
if os.environ.get("DJANGO_SETTINGS_MODULE") and self.settings_exception:
sys.stderr.write(str(self.settings_exception) + "\n")
sys.exit(1)
elif not settings.configured:
sys.stderr.write("No Django settings specified.\n")
possible_matches = get_close_matches(subcommand, commands)