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:
committed by
Markus Holtermann
parent
794c3f74c3
commit
e272904ff7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user