forked from CGM_Public/pretix_original
New Signal: order_expiry_changed (#4867)
Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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``
|
||||
|
||||
Reference in New Issue
Block a user