diff options
| author | Simon Charette <charette.s@gmail.com> | 2016-05-13 11:53:04 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2016-05-13 15:43:23 -0400 |
| commit | c0118ff80bd14fe0f65843e5df266ec5d922304d (patch) | |
| tree | bcb6174287e8144412827e3fa6950791fb4b6903 /django | |
| parent | 18900e55c52ac5e1455e0fd27b18ecdfd1442540 (diff) | |
Refs #24201 -- Ignored order_with_respect_to private fields in migrations.
Thanks Tim for the review.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/state.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py index 275d3b03a4..0134acde72 100644 --- a/django/db/migrations/state.py +++ b/django/db/migrations/state.py @@ -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 = [] |
