Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Do not sort delivery groups by status

Marcin Gębalaf8538b8f5688
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.py
index 78244c3946..3f2b630ae8 100644
--- a/saleor/dashboard/order/views.py
+++ b/saleor/dashboard/order/views.py
@@ -65,16 +65,9 @@ class OrderDetails(StaffMemberOnlyMixin, DetailView):
ctx['can_capture'] = ctx['can_release'] = ctx['can_refund'] = False
ctx['payment_form'] = self.payment_form_class()
- ctx['delivery_groups'] = self.get_delivery_groups()
+ ctx['delivery_groups'] = self.object.groups.select_subclasses().all()
return ctx
- def get_delivery_groups(self):
- def _cmp_status(x, y):
- _map = {'new': 1, 'shipped': 2, 'cancelled': 3}
- return cmp(_map[x.status], _map[y.status])
- groups = self.object.groups.select_subclasses().all()
- return sorted(groups, cmp=lambda x, y: _cmp_status(x, y))
-
def get(self, request, *args, **kwargs):
self.object = self.get_object()
ctx = self.get_context_data()