Opened 3 years ago

Closed 3 years ago

Last modified 3 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 Changed 3 years ago by Tim Graham

Triage Stage: UnreviewedAccepted
Version: master1.11

comment:2 Changed 3 years ago by Ian Foote

Owner: changed from nobody to Ian Foote
Status: newassigned

comment:3 Changed 3 years ago by Ian Foote

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

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 63afe3a2:

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

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

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