mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Fixed #22720 -- Migrations attempt to create _order twice.
This commit is contained in:
parent
7e3cf3cfd2
commit
6cfa2fae39
@ -167,7 +167,8 @@ class Options(object):
|
||||
if self.order_with_respect_to:
|
||||
self.order_with_respect_to = self.get_field(self.order_with_respect_to)
|
||||
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:
|
||||
self.order_with_respect_to = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user