mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Discounts: Add applicability date ranges (Z#23151897) (#4927)
* Add event date fields, add preliminary range check * Remove function, use filtered queryset for subevent id limit * Improve and fix date range check * Add formfields * Add tests * Improve tests * Add new fields to API and documentation * Add migration * Change description according to suggestion * Change discount apply signature, remove unnecessary query * Rename new fields, simplify range check * Rename fields in template * Apply suggestions from code review Co-authored-by: Raphael Michel <michel@rami.io> --------- Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -875,7 +875,8 @@ def _check_positions(event: Event, now_dt: datetime, time_machine_now_dt: dateti
|
||||
event,
|
||||
sales_channel.identifier,
|
||||
[
|
||||
(cp.item_id, cp.subevent_id, cp.line_price_gross, bool(cp.addon_to), cp.is_bundled, cp.listed_price - cp.price_after_voucher)
|
||||
(cp.item_id, cp.subevent_id, cp.subevent.date_from if cp.subevent_id else None, cp.line_price_gross,
|
||||
bool(cp.addon_to), cp.is_bundled, cp.listed_price - cp.price_after_voucher)
|
||||
for cp in sorted_positions
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user