Kaydet (Commit) 6cfa2fae authored tarafından Víðir Valberg Guðmundsson's avatar Víðir Valberg Guðmundsson

Fixed #22720 -- Migrations attempt to create _order twice.

üst 7e3cf3cf
......@@ -167,6 +167,7 @@ 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',)
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment