﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28014	"""manage.py makemigrations --check"" exits with 0 in case of exception"	Daniel Hahler	nobody	"In case there is an exception from one of the migrations, it will print this,
but exits with status code 0.


{{{
% manage.py makemigrations --check
INFO:root:settings.ENVIRONMENT: dev
Traceback (most recent call last):
  File ""…/project/bin/manage.py"", line 8, in <module>
    execute_from_command_line(sys.argv)
  File ""……/src/django/django/core/management/__init__.py"", line 367, in execute_from_command_line
    utility.execute()
  File ""……/src/django/django/core/management/__init__.py"", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""……/src/django/django/core/management/base.py"", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File ""……/src/django/django/core/management/base.py"", line 345, in execute
    output = self.handle(*args, **options)
  File ""……/src/django/django/core/management/commands/makemigrations.py"", line 95, in handle
    loader = MigrationLoader(None, ignore_no_migrations=True)
  File ""……/src/django/django/db/migrations/loader.py"", line 52, in __init__
    self.build_graph()
  File ""……/src/django/django/db/migrations/loader.py"", line 197, in build_graph
    self.load_disk()
  File ""……/src/django/django/db/migrations/loader.py"", line 108, in load_disk
    migration_module = import_module(""%s.%s"" % (module_name, migration_name))
  File ""…/pyenv/3.5.2/lib/python3.5/importlib/__init__.py"", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File ""<frozen importlib._bootstrap>"", line 986, in _gcd_import
  File ""<frozen importlib._bootstrap>"", line 969, in _find_and_load
  File ""<frozen importlib._bootstrap>"", line 958, in _find_and_load_unlocked
  File ""<frozen importlib._bootstrap>"", line 673, in _load_unlocked
  File ""<frozen importlib._bootstrap_external>"", line 665, in exec_module
  File ""<frozen importlib._bootstrap>"", line 222, in _call_with_frames_removed
  File ""…/app/migrations/0100_feedback.py"", line 12, in <module>
    raise Exception()
Exception
}}}


This might be more an issue of `manage.py` itself, which should exit non-zero
in case of any exception?!

{{{
try:
    execute_from_command_line(sys.argv)
except Exception as e:
    traceback.print_exc()
    sys.exit(3)
}}}
"	Bug	closed	Core (Management commands)	dev	Normal	worksforme			Unreviewed	0	0	0	0	0	0
