summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíðir Valberg Guðmundsson <valberg@orn.li>2014-05-29 01:00:30 +0200
committerVíðir Valberg Guðmundsson <valberg@orn.li>2014-05-29 01:00:30 +0200
commit6cfa2fae3963c11e4c8ad180decba2928736dba0 (patch)
treea8b22e7e939af6a1d768741ed249ff64822d34ef
parent7e3cf3cfd27e53ced0a1fc65a02849f78a292d3d (diff)
Fixed #22720 -- Migrations attempt to create _order twice.
-rw-r--r--django/db/models/options.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py
index a5f4280418..4f04746200 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -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