Skip to content

Commit

Permalink
Fix the generic placeholder for attendees
Browse files Browse the repository at this point in the history
People with just regular attendee badges were tripping the volunteer_placeholder email check because it didn't check a.staffing. They then (correctly) didn't actually get sent the volunteer email because they were not volunteering. Now the volunteer_placeholder function includes a.staffing so people can actually qualify for the generic placeholder.

Also fixes an issue where deferred attendees would also qualify for the generic placeholder because I was checking the truthiness of the function itself instead of calling it.
  • Loading branch information
kitsuta committed May 27, 2024
1 parent fa73b1a commit cf3eed8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions uber/automated_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,12 @@ def staff_import_placeholder(a): return a.placeholder and (a.registered_local <=
"staff import".lower() in a.admin_notes.lower()))


def volunteer_placeholder(a): return a.placeholder and a.registered_local > c.PREREG_OPEN
# a.staffing provided by StopsEmailFixture
def volunteer_placeholder(a): return a.staffing and a.placeholder and a.registered_local > c.PREREG_OPEN


# TODO: Add an email for MIVS judges, an email for non-Guest or Band guest group badges,
# and an email for group-leader-created badges
def generic_placeholder(a): return a.placeholder and (c.AT_THE_CON or not deferred_attendee_placeholder
def generic_placeholder(a): return a.placeholder and (not deferred_attendee_placeholder(a)
and not panelist_placeholder(a) and not guest_placeholder(a)
and not band_placeholder(a) and not dealer_placeholder(a)
and not staff_import_placeholder(a)
Expand Down Expand Up @@ -561,7 +560,7 @@ def generic_placeholder(a): return a.placeholder and (c.AT_THE_CON or not deferr
Attendee,
'Claim your deferred badge for {EVENT_NAME} {EVENT_YEAR}!',
'placeholders/deferred.html',
deferred_attendee_placeholder,
deferred_attendee_placeholder,
when=after(c.PREREG_OPEN),
ident='claim_deferred_badge')

Expand Down Expand Up @@ -613,7 +612,7 @@ def generic_placeholder(a): return a.placeholder and (c.AT_THE_CON or not deferr
StopsEmailFixture(
'Claim your Volunteer badge for {EVENT_NAME} {EVENT_YEAR}',
'placeholders/volunteer.txt',
lambda a: volunteer_placeholder(a),
volunteer_placeholder,
ident='volunteer_badge_confirmation')

AutomatedEmailFixture(
Expand Down
2 changes: 1 addition & 1 deletion uber/tasks/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def notify_admins_of_pending_emails():
'pending_emails_by_sender': emails_by_sender,
'primary_sender': sender,
}, encoding=None)
send_email(c.STAFF_EMAIL, sender, subject, body, format='html', model='n/a', session=session)
send_email(c.REPORTS_EMAIL, sender, subject, body, format='html', model='n/a', session=session)

return groupify(pending_emails, 'sender', 'ident')

Expand Down

0 comments on commit cf3eed8

Please sign in to comment.