forked from CGM_Public/pretix_original
Add order_gracefully_delete signal (#1454)
This commit is contained in:
committed by
Raphael Michel
parent
33cee65d7f
commit
25a998a510
@@ -39,6 +39,7 @@ from pretix.base.models import User
|
||||
from pretix.base.reldate import RelativeDateWrapper
|
||||
from pretix.base.services.locking import NoLockManager
|
||||
from pretix.base.settings import PERSON_NAME_SCHEMES
|
||||
from pretix.base.signals import order_gracefully_delete
|
||||
|
||||
from .base import LockModel, LoggedModel
|
||||
from .event import Event, SubEvent
|
||||
@@ -220,6 +221,7 @@ class Order(LockModel, LoggedModel):
|
||||
OrderPosition.all.filter(order=self, addon_to__isnull=False).delete()
|
||||
OrderPosition.all.filter(order=self).delete()
|
||||
OrderFee.all.filter(order=self).delete()
|
||||
order_gracefully_delete.send(self.event, order=self)
|
||||
self.refunds.all().delete()
|
||||
self.payments.all().delete()
|
||||
self.event.cache.delete('complain_testmode_orders')
|
||||
|
||||
@@ -391,6 +391,20 @@ as the first argument.
|
||||
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
|
||||
"""
|
||||
|
||||
order_gracefully_delete = EventPluginSignal(
|
||||
providing_args=["order"]
|
||||
)
|
||||
"""
|
||||
This signal is sent out every time a test-mode order is being deleted. The order object
|
||||
is given as the first argument.
|
||||
|
||||
Any plugin receiving this signals is supposed to perform any cleanup necessary at this
|
||||
point, so that the underlying oder has no more external constraints that would inhibit
|
||||
the deletion of the order.
|
||||
|
||||
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
|
||||
"""
|
||||
|
||||
logentry_display = EventPluginSignal(
|
||||
providing_args=["logentry"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user