Ticket #139 (closed defect: fixed)
Removing M2M causes crash
| Reported by: | evan.reiser@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.6 |
| Component: | commands | Version: | 0.6-pre |
| Keywords: | Cc: |
Description
removing a M2M field that has the through="SomeThroughTable?" causes a crash
C:\Python24\python.exe manage.py startmigration deals moving_verticalentities --auto
- Deleted field 'deals.vertical.entities'
Traceback (most recent call last):
File "manage.py", line 11, in ?
execute_manager(settings)
File "C:\Python24\lib\site-packages\django\core\management\init.py", line
340, in execute_manager
utility.execute()
File "C:\Python24\lib\site-packages\django\core\management\init.py", line
295, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python24\lib\site-packages\django\core\management\base.py", line 77,
in run_from_argv
self.execute(*args, options.dict)
File "C:\Python24\lib\site-packages\django\core\management\base.py", line 96,
in execute
output = self.handle(*args, options)
File "C:\Users\Evan Reiser\workspace\ValueWeekly?\south\management\commands\sta
rtmigration.py", line 384, in handle
forwards += DELETE_M2MFIELD_SNIPPET % (
File "C:\Python24\lib\site-packages\django\utils\functional.py", line 55, in _
curried
return _curried_func(*(args+moreargs), dict(kwargs, morekwargs))
File "C:\Python24\lib\site-packages\django\db\models\fields\related.py", line
770, in _get_m2m_db_table
return self.rel.through_model._meta.db_table
AttributeError?: 'ManyToManyRel?' object has no attribute 'through_model'
Attachments
Change History
comment:2 Changed 4 years ago by andrew
- Status changed from new to assigned
- Summary changed from evan.reiser@gmail.com to Removing M2M causes crash
- Version set to subversion
- Reporter changed from anonymous to evan.reiser@…
- Milestone set to 0.6
This looks suspiciously like a Django bug; that last line of the traceback is in a core Django part, and it's definitely called self.through. What Django version are you using?

er sorry didnt enter the ticket correctly