1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #29831 -- Added validation for makemigrations --name.

This commit is contained in:
Prabakaran Kumaresshan
2018-10-19 12:26:33 +05:30
committed by Tim Graham
parent 136a900ef9
commit 10d82c85aa
3 changed files with 9 additions and 1 deletions

View File

@@ -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