mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Added dispatch_uid argument to all receivers to prevent duplicate
execution
This commit is contained in:
@@ -25,7 +25,7 @@ that we'll soon create::
|
||||
from pretix.base.signals import register_data_exporter
|
||||
|
||||
|
||||
@receiver(register_data_exporter)
|
||||
@receiver(register_data_exporter, dispatch_uid="exporter_myexporter")
|
||||
def register_data_exporter(sender, **kwargs):
|
||||
from .exporter import MyExporter
|
||||
return MyExporter
|
||||
|
||||
@@ -21,7 +21,7 @@ that we'll soon create::
|
||||
from pretix.base.signals import register_payment_providers
|
||||
|
||||
|
||||
@receiver(register_payment_providers)
|
||||
@receiver(register_payment_providers, dispatch_uid="payment_paypal")
|
||||
def register_payment_provider(sender, **kwargs):
|
||||
from .payment import Paypal
|
||||
return Paypal
|
||||
|
||||
@@ -108,7 +108,7 @@ In our example, the implementation could look like this::
|
||||
from .models import TimeRestriction
|
||||
|
||||
|
||||
@receiver(determine_availability)
|
||||
@receiver(determine_availability, dispatch_uid="restriction_time")
|
||||
def availability_handler(sender, **kwargs):
|
||||
# Handle the signal's input arguments
|
||||
item = kwargs['item']
|
||||
@@ -273,7 +273,7 @@ Our time restriction example looks like this::
|
||||
]
|
||||
|
||||
|
||||
@receiver(restriction_formset)
|
||||
@receiver(restriction_formset, dispatch_uid="restriction_formset_time")
|
||||
def formset_handler(sender, **kwargs):
|
||||
formset = inlineformset_factory(
|
||||
Item,
|
||||
|
||||
@@ -24,7 +24,7 @@ that we'll soon create::
|
||||
from pretix.base.signals import register_ticket_outputs
|
||||
|
||||
|
||||
@receiver(register_ticket_outputs)
|
||||
@receiver(register_ticket_outputs, dispatch_uid="output_pdf")
|
||||
def register_ticket_output(sender, **kwargs):
|
||||
from .ticketoutput import PdfTicketOutput
|
||||
return PdfTicketOutput
|
||||
|
||||
Reference in New Issue
Block a user