django_program.sponsors.signals

Auto-voucher generation signal for the sponsors app.

Functions

generate_comp_vouchers(sender, instance, ...)

Create complimentary vouchers when a new sponsor is saved.

django_program.sponsors.signals.generate_comp_vouchers(sender, instance, created, **kwargs)[source]

Create complimentary vouchers when a new sponsor is saved.

Generates one Voucher per complimentary ticket defined on the sponsor’s level. Each voucher is a single-use, 100 % comp code that also unlocks hidden ticket types. bulk_create with ignore_conflicts=True makes the operation idempotent.

Parameters:
  • sender (object) – The model class that sent the signal.

  • instance (Sponsor) – The Sponsor instance that was saved.

  • created (bool) – True when the instance was just inserted.

  • **kwargs (object) – Additional keyword arguments passed by the signal.

Return type:

None