Commit 6cfa2fae authored by Víðir Valberg Guðmundsson's avatar Víðir Valberg Guðmundsson
Browse files

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

parent 7e3cf3cf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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