1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #24201 -- Ignored order_with_respect_to private fields in migrations.

Thanks Tim for the review.
This commit is contained in:
Simon Charette
2016-05-13 11:53:04 -04:00
parent 18900e55c5
commit c0118ff80b
2 changed files with 17 additions and 0 deletions

View File

@@ -443,6 +443,9 @@ class ModelState(object):
for key in ["unique_together", "index_together", "order_with_respect_to"]:
if key in options:
del options[key]
# Private fields are ignored, so remove options that refer to them.
elif options.get('order_with_respect_to') in {field.name for field in model._meta.private_fields}:
del options['order_with_respect_to']
def flatten_bases(model):
bases = []