mirror of
https://github.com/django/django.git
synced 2025-03-31 03:30:46 +00:00
[1.7.x] Fixed #22720 -- Migrations attempt to create _order twice.
Backport of 6cfa2fae39 from master
This commit is contained in:
parent
b8b1fbd4c1
commit
0ee27d5b62
@ -179,7 +179,8 @@ class Options(object):
|
|||||||
if self.order_with_respect_to:
|
if self.order_with_respect_to:
|
||||||
self.order_with_respect_to = self.get_field(self.order_with_respect_to)
|
self.order_with_respect_to = self.get_field(self.order_with_respect_to)
|
||||||
self.ordering = ('_order',)
|
self.ordering = ('_order',)
|
||||||
model.add_to_class('_order', OrderWrt())
|
if not any(isinstance(field, OrderWrt) for field in model._meta.local_fields):
|
||||||
|
model.add_to_class('_order', OrderWrt())
|
||||||
else:
|
else:
|
||||||
self.order_with_respect_to = None
|
self.order_with_respect_to = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user