forked from CGM_Public/pretix_original
Add support for reserved seating (#1228)
* Initial work on seating * Add seat guids * Add product_list_top * CartAdd: Ignore item when a seat is passed * Cart display * product_list_top → render_seating_plan * Render seating plan in voucher redemption * Fix failing tests * Add tests for extending cart positions with seats * Add subevent_forms to docs * Update schema, migrations * Dealing with expired orders * steps to order change * Change order positions * Allow to add seats * tests for ocm * Fix things after rebase * Seating plans API * Add more tests for cart behaviour * Widget support * Adjust widget tests * Re-enable CSP * Update schema * Api: position.seat * Add guid to word list * API: (sub)event.seating_plan * Vali fixes * Fix api * Fix reference in test * Fix test for real
This commit is contained in:
@@ -59,7 +59,7 @@ class CartMixin:
|
||||
cartpos = queryset.order_by(
|
||||
'item__category__position', 'item__category_id', 'item__position', 'item__name', 'variation__value'
|
||||
).select_related(
|
||||
'item', 'variation', 'addon_to', 'subevent', 'subevent__event', 'subevent__event__organizer'
|
||||
'item', 'variation', 'addon_to', 'subevent', 'subevent__event', 'subevent__event__organizer', 'seat'
|
||||
).prefetch_related(
|
||||
*prefetch
|
||||
)
|
||||
@@ -103,13 +103,13 @@ class CartMixin:
|
||||
)
|
||||
addon_penalty = 1 if pos.addon_to else 0
|
||||
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)
|
||||
return i, addon_penalty, pos.pk, 0, 0, 0, 0, (pos.subevent_id or 0), pos.seat_id
|
||||
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)
|
||||
return i, addon_penalty, pos.pk, 0, 0, 0, 0, (pos.subevent_id or 0), pos.seat_id
|
||||
|
||||
return (
|
||||
0, addon_penalty, 0, pos.item_id, pos.variation_id, pos.price, (pos.voucher_id or 0),
|
||||
(pos.subevent_id or 0)
|
||||
(pos.subevent_id or 0), pos.seat_id
|
||||
)
|
||||
|
||||
positions = []
|
||||
|
||||
Reference in New Issue
Block a user