Check if tickets are generated. Also show if tickets are generated in the admin.
This commit is contained in:
parent
ac19a6db4b
commit
74a9e9df71
|
@ -5,7 +5,7 @@ from .models import Sponsor, SponsorTier
|
||||||
|
|
||||||
@admin.register(Sponsor)
|
@admin.register(Sponsor)
|
||||||
class SponsorAdmin(admin.ModelAdmin):
|
class SponsorAdmin(admin.ModelAdmin):
|
||||||
list_display = ("name", "tier", "ticket_email", "ticket_ready", "tickets_sent")
|
list_display = ("name", "tier", "ticket_email", "ticket_ready", "tickets_sent", "tickets_generated")
|
||||||
list_filter = ("tier__camp",)
|
list_filter = ("tier__camp",)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,13 @@ class Command(BaseCommand):
|
||||||
sponsors = Sponsor.objects.filter(tier__camp=camp, tickets_generated=False)
|
sponsors = Sponsor.objects.filter(tier__camp=camp, tickets_generated=False)
|
||||||
|
|
||||||
for sponsor in sponsors:
|
for sponsor in sponsors:
|
||||||
if sponsor.tier.tickets and sponsor.ticket_email and sponsor.ticket_ready and not sponsor.tickets_sent:
|
if (
|
||||||
|
sponsor.tier.tickets and
|
||||||
|
sponsor.tickets_generated and
|
||||||
|
sponsor.ticket_email and
|
||||||
|
sponsor.ticket_ready and
|
||||||
|
not sponsor.tickets_sent
|
||||||
|
):
|
||||||
self.output("# Generating outgoing email to send tickets for {}:".format(sponsor))
|
self.output("# Generating outgoing email to send tickets for {}:".format(sponsor))
|
||||||
# send the email
|
# send the email
|
||||||
if add_sponsorticket_email(sponsor=sponsor):
|
if add_sponsorticket_email(sponsor=sponsor):
|
||||||
|
|
Loading…
Reference in a new issue