Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#21010 closed Bug (fixed)

ModelState.fields contain fields from parents in MTI.

Reported by: loic84 Owned by: Tim Graham <timograham@…>
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


This causes FieldError: Local field 'field' in class 'Model1' clashes with field of similar name from base class 'Model2' when the ModelState is rendered.

Change History (3)

comment:1 Changed 2 years ago by loic84

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

  • Owner set to Tim Graham <timograham@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 34d52fd32ed6192daa37e3fc1303cc5661130bad:

Fixed #21010 -- Changed ModelState to only copy _meta.local_fields.

comment:3 Changed 2 years ago by Baptiste Mispelon <bmispelon@…>

In 72479a29579f72a7713ac3c07eb92f5bafee25bd:

Made the migration detector use meta.local_fields instead of meta.fields.

Refs #21010.

Thanks to Loïc for the patch.

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