Opened 10 years ago

Closed 10 years ago

#7245 closed (invalid)

[BUG] Data row duplication while changing inherited models using oldforms manipulators

Reported by: m.gajda@… Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: bug oldforms row duplication change
Cc: m.gajda@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


I've discovered using admin application, that while trying to save some existing object, which model class inherits from other model class, a new rows are added to database instead of changing the existing ones.

The problem is save method of the django.db.models.manipulators.AutomaticManipulator class, which does not set primary key values for super class models, which should be later processed by model's save method.

The attached patch tries to solve this bug by setting primary key values on all super models while preparing data to save in manipulator class. It works for me, but I did not run test suites to check the behaviour in all cases.

Attachments (1)

propagate-all-pk-values-7245.patch (678 bytes) - added by m.gajda@… 10 years ago.
Propagate all pk values patch

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by m.gajda@…

Propagate all pk values patch

comment:1 Changed 10 years ago by Jeff Anderson

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 10 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

Closing, because manipulators are gone.

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