Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1064 closed defect (fixed)

[patch] ManyToManyField pointing at a model that contains a OneToOneField is broken

Reported by: bruce@… Owned by: mtredinnick
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you have a ManyToManyField pointing at a model that uses a OneToOneField, then the model with the OneToOneField has no attribute "id" which causes the code in method_set_many_to_many to fail due to it relying on the presence of an attribute "id".

Luminosity helped figure out the correct fix and I will attach the patch that fixes the problem.

Attachments (1)

onetoonefix.diff (698 bytes) - added by bruce@… 9 years ago.
Fix!

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by bruce@…

Fix!

comment:1 Changed 9 years ago by django@…

  • Summary changed from ManyToManyField pointing at a model that contains a OneToOneField is broken to [patch] ManyToManyField pointing at a model that contains a OneToOneField is broken

comment:2 Changed 9 years ago by mtredinnick

  • Owner changed from adrian to mtredinnick

Looks like this has been fixed "en passant", but I'll leave it open until I can find a place to put the test that proves this.

comment:3 Changed 9 years ago by mtredinnick

(In [3176]) Added regressions tests to ensure that one-to-one and many-to-many fields
continue to interact properly. Refs #1064. Refs #1506.

comment:4 Changed 9 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top