diff options
| author | oliver <myungsekyo@gmail.com> | 2018-06-17 04:18:57 +0900 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-06-16 15:19:08 -0400 |
| commit | d03b130cbcc629daa5ae767588b2fff41ea1e48a (patch) | |
| tree | c1dce9a262bbc4cf198bf950a3a0ba3846247a7a /django | |
| parent | 8cbfaf29c06ffc8b81c12ef30e0d151cae2d9712 (diff) | |
[2.1.x] Fixed #29469 -- Added a helpful makemigrations error if app_label contains dots.
Backport of 78972af367a1da54aa7e539e4b1ffa2b56571e77 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/makemigrations.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py index 14461418c1..1a166c6f99 100644 --- a/django/core/management/commands/makemigrations.py +++ b/django/core/management/commands/makemigrations.py @@ -73,7 +73,15 @@ class Command(BaseCommand): bad_app_labels.add(app_label) if bad_app_labels: for app_label in bad_app_labels: - self.stderr.write("App '%s' could not be found. Is it in INSTALLED_APPS?" % app_label) + if '.' in app_label: + self.stderr.write( + "'%s' is not a valid app label. Did you mean '%s'?" % ( + app_label, + app_label.split('.')[-1], + ) + ) + else: + self.stderr.write("App '%s' could not be found. Is it in INSTALLED_APPS?" % app_label) sys.exit(2) # Load the current graph state. Pass in None for the connection so |
