Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#24034 closed Bug (fixed)

ArrayField.deconstruct always overwrites path

Reported by: Jernej Kos Owned by: Jernej Kos <jernej@…>
Component: contrib.postgres Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The new django.contrib.postgres.fields.ArrayField seems to always overwrite the path element in the returned deconstruct tuple instead of using the path generated by Field base class. This causes the path to be wrong in ArrayField subclasses and requires it to be explicitly set instead of just using the one generated by the Field base class.

It would be better to change it to something like in the Field class, where the current value of the path is checked first before rewriting the path into a shorter form.

Change History (3)

comment:1 by Simon Charette, 10 years ago

Has patch: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

comment:2 by Jernej Kos <jernej@…>, 10 years ago

Owner: set to Jernej Kos <jernej@…>
Resolution: fixed
Status: newclosed

In 7c50e7eeccd4b4581542547f5ddb603bbd62a725:

Fixed #24034 -- Don't always overwrite deconstruct path.

Made deconstruct path overwriting for ArrayField conditional,
so it only occurs when the deconstructed field is an instance
of ArrayField itself and not a subclass.

comment:3 by Marc Tamlyn <marc.tamlyn@…>, 10 years ago

In 936e87c97ba57c75708a240d9bfe71215d84faa3:

Merge pull request #3765 from wlanslovenija/ticket_24034

Fixed #24034 -- Don't always overwrite deconstruct path.

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