mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Sort positions by ID
This commit is contained in:
@@ -163,7 +163,7 @@ class OrderDetail(OrderView):
|
|||||||
'item', 'variation'
|
'item', 'variation'
|
||||||
).prefetch_related(
|
).prefetch_related(
|
||||||
'item__questions', 'answers', 'answers__question'
|
'item__questions', 'answers', 'answers__question'
|
||||||
)
|
).order_by('positionid')
|
||||||
|
|
||||||
positions = []
|
positions = []
|
||||||
for p in cartpos:
|
for p in cartpos:
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ class CartMixin:
|
|||||||
# Django is unable to join related models in a .values() query
|
# Django is unable to join related models in a .values() query
|
||||||
def keyfunc(pos):
|
def keyfunc(pos):
|
||||||
if downloads:
|
if downloads:
|
||||||
return pos.id, 0, 0, 0, 0
|
return pos.positionid, 0, 0, 0, 0
|
||||||
if answers and ((pos.item.admission and self.request.event.settings.attendee_names_asked)
|
if answers and ((pos.item.admission and self.request.event.settings.attendee_names_asked)
|
||||||
or pos.item.questions.all()):
|
or pos.item.questions.all()):
|
||||||
return pos.id, 0, 0, 0, 0
|
return pos.positionid, 0, 0, 0, 0
|
||||||
return 0, pos.item_id, pos.variation_id, pos.price, (pos.voucher_id or 0)
|
return 0, pos.item_id, pos.variation_id, pos.price, (pos.voucher_id or 0)
|
||||||
|
|
||||||
positions = []
|
positions = []
|
||||||
|
|||||||
Reference in New Issue
Block a user