summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorPrabakaran Kumaresshan <k_prabakaran@hotmail.com>2018-10-19 12:26:33 +0530
committerTim Graham <timograham@gmail.com>2018-10-23 10:05:24 -0400
commit10d82c85aa5f8bd6adff0db49798dd368455cdcf (patch)
tree76e2494c9d348e3ad5dac5fe5d40c15bc47986bb /django/core
parent136a900ef98a7b7261a124308c8c26370ff2d5e4 (diff)
Fixed #29831 -- Added validation for makemigrations --name.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management/commands/makemigrations.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py
index ea90467d22..cdccb8e9b3 100644
--- a/django/core/management/commands/makemigrations.py
+++ b/django/core/management/commands/makemigrations.py
@@ -61,6 +61,8 @@ class Command(BaseCommand):
self.merge = options['merge']
self.empty = options['empty']
self.migration_name = options['name']
+ if self.migration_name and not self.migration_name.isidentifier():
+ raise CommandError('The migration name must be a valid Python identifier.')
check_changes = options['check_changes']
# Make sure the app they asked for exists