Opened 10 years ago

Closed 9 years ago

Last modified 9 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, 10 years ago

Triage Stage: Unreviewed → Accepted
Version: master → 1.11

comment:2 by Ian Foote, 10 years ago

Owner: changed from nobody to Ian Foote
Status: new → assigned

comment:3 by Ian Foote, 10 years ago

Has patch: set
Version 0, edited 10 years ago by Ian Foote (next)

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

Resolution: → fixed
Status: assigned → closed

In 63afe3a2:

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

comment:5 by Tim Graham <timograham@…>, 9 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