Ticket #139 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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'

Change History

comment:1 Changed 5 years ago by evan.reiser@…

er sorry didnt enter the ticket correctly

comment:2 Changed 5 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?

comment:3 Changed 5 years ago by evan.reiser@…

I think we were using django r9037 (post 1.0) which is pretty old, so that def might be the problem

comment:4 Changed 5 years ago by andrew

Any update on this?

comment:5 Changed 5 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to fixed

This seems to be fixed with recent Djangos, so marking as fixed.

Note: See TracTickets for help on using tickets.