Opened 11 years ago

Closed 11 years ago

#21469 closed Bug (fixed)

makemigrations and normalize_unique_together

Reported by: django@… Owned by: Baptiste Mispelon <bmispelon@…>
Component: Migrations Version: dev
Severity: Normal Keywords:
Cc: Baptiste Mispelon Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

normalize_unique_together breaks when it is given a set(), but that's what Django migration's autodetector provides when running makemigrations.

To reproduce:

  • Create a model with unique_together
  • Run makemigrations

Seems to have been introduced on Oct 7 in the fix for #21236 (4dbd95a)

Change History (4)

comment:1 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Baptiste Mispelon, 11 years ago

Cc: Baptiste Mispelon added
Has patch: set

What about simply forcing unique_together to be a tuple at the beginning of normalize_unique_together()?

PR (with tests) here: https://github.com/django/django/pull/1946

comment:3 by Tim Graham, 11 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Baptiste Mispelon <bmispelon@…>, 11 years ago

Owner: set to Baptiste Mispelon <bmispelon@…>
Resolution: fixed
Status: newclosed

In 331d79a77d48e1a46df0290689d4d865e67221c4:

Fixed #21469 -- Allow set objects in Meta.unique_together.

Thanks to Tim for the review.

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