This commit is contained in:
Kara Engelhardt
2026-03-18 10:25:34 +01:00
parent affb32c513
commit cfcd0f4206
13 changed files with 536 additions and 40 deletions

View File

@@ -20,22 +20,16 @@
# <https://www.gnu.org/licenses/>.
#
from django.dispatch import receiver
from pretix.base.signals import register_ticket_outputs
from .ticketoutput import OUTPUTS
def connect_signals():
for output in OUTPUTS:
# DIY functools.partial to make get_defining_app happy
def get_register_func(o):
def register(sender, **kwargs):
return o
return register
register_ticket_outputs.connect(get_register_func(output), dispatch_uid=f"output_{output.identifier}")
@receiver(register_ticket_outputs, dispatch_uid="output_wallet")
def register_ticket_wallet(sender, **kwargs):
from .ticketoutput import WalletTicketOutput
return WalletTicketOutput
@receiver(register_ticket_outputs, dispatch_uid="output_wallet_apple")
def register_ticket_wallet_apple(sender, **kwargs):
from .ticketoutput import AppleWalletTicketOutput
return AppleWalletTicketOutput
@receiver(register_ticket_outputs, dispatch_uid="output_wallet_google")
def register_ticket_wallet_google(sender, **kwargs):
from .ticketoutput import GoogleWalletTicketOutput
return GoogleWalletTicketOutput
connect_signals()