New Signal: order_expiry_changed (#4867)

Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
Martin Gross
2025-02-25 13:38:26 +01:00
committed by GitHub
parent b48259ab60
commit 083e5ed265
3 changed files with 15 additions and 3 deletions

View File

@@ -98,8 +98,9 @@ from pretix.base.services.quotas import QuotaAvailability
from pretix.base.services.tasks import ProfiledEventTask, ProfiledTask
from pretix.base.signals import (
order_approved, order_canceled, order_changed, order_denied, order_expired,
order_fee_calculation, order_paid, order_placed, order_reactivated,
order_split, order_valid_if_pending, periodic_task, validate_order,
order_expiry_changed, order_fee_calculation, order_paid, order_placed,
order_reactivated, order_split, order_valid_if_pending, periodic_task,
validate_order,
)
from pretix.base.timemachine import time_machine_now, time_machine_now_assigned
from pretix.celery_app import app
@@ -302,6 +303,7 @@ def extend_order(order: Order, new_date: datetime, force: bool=False, valid_if_p
'state_change': was_expired
}
)
order_expiry_changed.send(sender=order.event, order=order)
if was_expired:
num_invoices = order.invoices.filter(is_cancellation=False).count()

View File

@@ -563,6 +563,16 @@ as the first argument.
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
order_expiry_changed = EventPluginSignal()
"""
Arguments: ``order``
This signal is sent out every time an order expiry date is changed as an explicit operation (i.e. not if
this is the result of an approval or order change). The order object is given as the first argument.
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
order_modified = EventPluginSignal()
"""
Arguments: ``order``