diff options
| author | Huu Nguyen <whoshuu@gmail.com> | 2014-06-19 12:24:59 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-14 11:00:49 -0400 |
| commit | f7a78f9bba4efd0231aec0326a73fdbd004d1faa (patch) | |
| tree | dedeef3777a304482d88ff119712d30e3e9db0e4 /django | |
| parent | efe87d3e48df9b7470a3006eeb7322f12b368fdf (diff) | |
Fixed #22791 -- Invoke interactive questioner only for conflicts in specified apps.
Thanks bendavis78 for the report and Tim Graham for the review.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/makemigrations.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py index 42e57cd17d..b1a9e0c017 100644 --- a/django/core/management/commands/makemigrations.py +++ b/django/core/management/commands/makemigrations.py @@ -10,6 +10,7 @@ from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.questioner import MigrationQuestioner, InteractiveMigrationQuestioner from django.db.migrations.state import ProjectState from django.db.migrations.writer import MigrationWriter +from django.utils.six import iteritems from django.utils.six.moves import reduce @@ -56,6 +57,14 @@ class Command(BaseCommand): # Before anything else, see if there's conflicting apps and drop out # hard if there are any and they don't want to merge conflicts = loader.detect_conflicts() + + # If app_labels is specified, filter out conflicting migrations for unspecified apps + if app_labels: + conflicts = dict( + (app_label, conflict) for app_label, conflict in iteritems(conflicts) + if app_label in app_labels + ) + if conflicts and not self.merge: name_str = "; ".join( "%s in %s" % (", ".join(names), app) |
