Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#28043 closed Bug (fixed)

Cloning a ModelState fails to deepcopy all options

Reported by: Ian Foote Owned by: Ian Foote
Component: Migrations Version: 1.11
Severity: Release blocker Keywords: ModelState clone indexes
Cc: Markus Holtermann Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In ModelState.clone, we copy the self.options dictionary, but this fails to copy any mutable values, specifically indexes. Since AddIndex.state_forwards mutates indexes, this leads to an invalid state.

Change History (5)

comment:1 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted
Version: master1.11

comment:2 by Ian Foote, 8 years ago

Owner: changed from nobody to Ian Foote
Status: newassigned

comment:3 by Ian Foote, 8 years ago

Has patch: set
Last edited 8 years ago by Tim Graham (previous) (diff)

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 63afe3a2:

Fixed #28043 -- Prevented AddIndex and RemoveIndex from mutating model state.

comment:5 by Tim Graham <timograham@…>, 8 years ago

In 211d2bf3:

[1.11.x] Fixed #28043 -- Prevented AddIndex and RemoveIndex from mutating model state.

Backport of 63afe3a2bfaf97fecff6641137a85296029d5b73 from master

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