Fix cart grouping function to include membership and validity (#3991)

* Fix cart grouping function to include membership and validity

* Update src/pretix/presale/views/__init__.py

Co-authored-by: Mira <weller@rami.io>

---------

Co-authored-by: Mira <weller@rami.io>
This commit is contained in:
Raphael Michel
2024-03-19 10:17:26 +01:00
committed by GitHub
parent f121205dd1
commit 99b4c5bd36

View File

@@ -170,9 +170,20 @@ class CartMixin:
)
if not grouping_allowed:
return (pos.pk,) + (0, ) * 6
return (pos.pk,)
else:
return (pos.addon_to_id or 0), pos.subevent_id, pos.item_id, pos.variation_id, pos.price, (pos.voucher_id or 0), (pos.seat_id or 0)
return (
(pos.addon_to_id or 0),
pos.subevent_id,
pos.item_id,
pos.variation_id,
pos.price,
(pos.voucher_id or 0),
(pos.seat_id or 0),
pos.valid_from,
pos.valid_until,
pos.used_membership_id,
)
positions = []
for k, g in groupby(sorted(lcp, key=lambda c: c.sort_key), key=group_key):