diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/makemigrations.py | 2 |
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 |
