Opened 9 years ago

Last modified 9 years ago

#25807 closed Bug

makemigrations failed when CharField has validators=[validate_slug] — at Initial Version

Reported by: mrgaolei Owned by: nobody
Component: Migrations Version: 1.9rc1
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Version 1.9rc1
When CharField have a validators=[validate_slug], it can not be makemigrations.

it prompt:
`
Traceback (most recent call last):

File "./manage.py", line 10, in <module>

execute_from_command_line(sys.argv)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/core/management/init.py", line 350, in execute_from_command_line

utility.execute()

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/core/management/init.py", line 342, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv

self.execute(*args, cmd_options)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute

output = self.handle(*args, options)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 150, in handle

self.write_migration_files(changes)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 178, in write_migration_files

migration_string = writer.as_string()

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 167, in as_string

operation_string, operation_imports = OperationWriter(operation).serialize()

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 124, in serialize

_write(arg_name, arg_value)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 76, in _write

arg_string, arg_imports = MigrationWriter.serialize(item)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 353, in serialize

item_string, item_imports = cls.serialize(item)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 429, in serialize

return cls.serialize_deconstructed(path, args, kwargs)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 318, in serialize_deconstructed

arg_string, arg_imports = cls.serialize(arg)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 353, in serialize

item_string, item_imports = cls.serialize(item)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 473, in serialize

return cls.serialize_deconstructed(*value.deconstruct())

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 314, in serialize_deconstructed

arg_string, arg_imports = cls.serialize(arg)

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/db/migrations/writer.py", line 512, in serialize

for item in value:

File "/Users/mrgaolei/Desktop/proton/venv/lib/python2.7/site-packages/django/utils/functional.py", line 205, in inner

return func(self._wrapped, *args)

TypeError: '_sre.SRE_Pattern' object is not iterable
`

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top