Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit d8919af

Browse files
authored
Fix the speaker coupon script for EP2021. (#1436)
Remove coupons for people on the waitlist. Adjust the talk admin to show the admin type, which is used to filter out coupon eligible talks or apply special casing for e.g. keynotes.
1 parent e746afe commit d8919af

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

p3/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class TalkAdmin(admin.ModelAdmin):
9090
"status",
9191
"duration",
9292
"type",
93+
"admin_type",
9394
"level",
94-
"tags__name",
9595
)
9696
list_editable = ("status",)
9797
search_fields = [
@@ -112,6 +112,7 @@ class TalkAdmin(admin.ModelAdmin):
112112
"type",
113113
"duration",
114114
"status",
115+
"admin_type",
115116
"created",
116117
"level",
117118
"domain_level",

p3/management/commands/create_speaker_coupons.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
to get recreated, deleted it in the database first and then run
1515
the script.
1616
17+
There are several special cases handled by the script, e.g. when
18+
setting the admin type to keynote. Please check below for details.
19+
1720
Use --dry-run to test drive the script.
1821
1922
WARNING: This script will create coupons for all speakers,
@@ -105,7 +108,7 @@ def handle(self, *args, **options):
105108
speakers = {}
106109
qs = cmodels.TalkSpeaker.objects\
107110
.filter(Q(talk__conference=conference.code),
108-
Q(talk__status='accepted') | Q(talk__status='waitlist'),
111+
Q(talk__status='accepted'),
109112
Q(helper=False))\
110113
.select_related('talk', 'speaker__user')
111114
for row in qs:
@@ -144,11 +147,6 @@ def handle(self, *args, **options):
144147
entry['discount'] != '100%'):
145148
entry = None
146149

147-
if talk_code == 'r' and talk_status == 'waitlist':
148-
# Training entries on the waiting list only get a
149-
# 25% coupon, not a 100% one
150-
discount_code = '25%'
151-
152150
# Entry already exists, so don't create a new coupon
153151
if entry is not None:
154152
continue

0 commit comments

Comments
 (0)