forked from CGM_Public/pretix_original
- [x] Data model - [x] UI - [x] Fire hooks - [x] Unit tests - [x] Display logs - [x] API to modify hooks - [x] Documentation - [x] More hooks!
22 lines
596 B
Python
22 lines
596 B
Python
from datetime import timedelta
|
|
|
|
from django.dispatch import Signal, receiver
|
|
from django.utils.timezone import now
|
|
|
|
from pretix.api.models import WebHookCall
|
|
from pretix.base.signals import periodic_task
|
|
|
|
register_webhook_events = Signal(
|
|
providing_args=[]
|
|
)
|
|
"""
|
|
This signal is sent out to get all known webhook events. Receivers should return an
|
|
instance of a subclass of pretix.api.webhooks.WebhookEvent or a list of such
|
|
instances.
|
|
"""
|
|
|
|
|
|
@receiver(periodic_task)
|
|
def cleanup_webhook_logs(sender, **kwargs):
|
|
WebHookCall.objects.filter(datetime__lte=now() - timedelta(days=30)).delete()
|