Webhooks: Add vouchers (Z#23203072) (#5360)

* Webhooks: Add vouchers (Z#23203072)

This also requires more consistent usage of webhook types to avoid
vouchers not being known to the external system.

* Update src/pretix/api/webhooks.py

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

* Fix shredder test

---------

Co-authored-by: luelista <weller@rami.io>
This commit is contained in:
Raphael Michel
2025-08-19 13:04:22 +02:00
committed by GitHub
parent 7cdccc7d8e
commit 0cc8e59bb0
7 changed files with 59 additions and 12 deletions

View File

@@ -207,16 +207,19 @@ class WaitingListEntry(LoggedModel):
block_quota=True,
subevent=self.subevent,
)
v.log_action('pretix.voucher.added.waitinglist', {
v.log_action('pretix.voucher.added', {
'item': self.item.pk,
'variation': self.variation.pk if self.variation else None,
'tag': 'waiting-list',
'block_quota': True,
'valid_until': v.valid_until.isoformat(),
'max_usages': 1,
'subevent': self.subevent.pk if self.subevent else None,
'source': 'waitinglist',
}, user=user, auth=auth)
v.log_action('pretix.voucher.added.waitinglist', {
'email': self.email,
'waitinglistentry': self.pk,
'subevent': self.subevent.pk if self.subevent else None,
}, user=user, auth=auth)
self.voucher = v
self.save()