1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #23407 -- Extended coverage of makemigrations --noinput option.

Changed --noinput option in makemigrations to suppress all user prompts,
not just when combined with --merge.
This commit is contained in:
Marten Kenbeek
2015-03-07 13:53:13 +01:00
committed by Markus Holtermann
parent 794c3f74c3
commit e272904ff7
4 changed files with 97 additions and 4 deletions

View File

@@ -180,3 +180,14 @@ class InteractiveMigrationQuestioner(MigrationQuestioner):
"Do you want to merge these migration branches? [y/N]",
False,
)
class NonInteractiveMigrationQuestioner(MigrationQuestioner):
def ask_not_null_addition(self, field_name, model_name):
# We can't ask the user, so act like the user aborted.
sys.exit(3)
def ask_not_null_alteration(self, field_name, model_name):
# We can't ask the user, so set as not provided.
return NOT_PROVIDED