Opened 7 years ago

Closed 7 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: UI/UX:

Description

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@… 7 years ago.
Propagate all pk values patch

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by m.gajda@…

Propagate all pk values patch

comment:1 Changed 7 years ago by programmerq

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

Closing, because manipulators are gone.

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