CartMixin: Prevent None values in sorting function

This commit is contained in:
Raphael Michel
2020-04-02 16:53:17 +02:00
parent a1caa65776
commit c7dd50de0d
+4 -4
View File
@@ -110,13 +110,13 @@ class CartMixin:
) )
addon_penalty = 1 if pos.addon_to else 0 addon_penalty = 1 if pos.addon_to else 0
if downloads or pos.pk in has_addons or pos.addon_to: if downloads or pos.pk in has_addons or pos.addon_to:
return i, addon_penalty, pos.pk, 0, 0, 0, 0, (pos.subevent_id or 0), pos.seat_id return i, addon_penalty, pos.pk, 0, 0, 0, 0, (pos.subevent_id or 0), (pos.seat_id or 0)
if answers and (has_attendee_data or pos.item.questions.all()): if answers and (has_attendee_data or pos.item.questions.all()):
return i, addon_penalty, pos.pk, 0, 0, 0, 0, (pos.subevent_id or 0), pos.seat_id return i, addon_penalty, pos.pk, 0, 0, 0, 0, (pos.subevent_id or 0), (pos.seat_id or 0)
return ( return (
0, addon_penalty, 0, pos.item_id, pos.variation_id, pos.price, (pos.voucher_id or 0), 0, addon_penalty, 0, pos.item_id, (pos.variation_id or 0), pos.price, (pos.voucher_id or 0),
(pos.subevent_id or 0), pos.seat_id (pos.subevent_id or 0), (pos.seat_id or 0)
) )
positions = [] positions = []