feat(grants): Pretix voucher and email when grantee confirms#4602
feat(grants): Pretix voucher and email when grantee confirms#4602
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR wires up Pretix voucher creation and email sending when a grantee confirms their grant, and consolidates the Missing transaction in The Race condition in
Silent skip for SPEAKER voucher type in admin action When an existing GRANT or SPEAKER voucher is found in Missing test: Pretix failure path in No test covers |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4602 +/- ##
=======================================
Coverage 92.51% 92.52%
=======================================
Files 359 359
Lines 10764 10791 +27
Branches 814 821 +7
=======================================
+ Hits 9958 9984 +26
Misses 696 696
- Partials 110 111 +1 🚀 New features to boost your workflow:
|
|
@claude do the code review again |
|
Claude finished @estyxx's task in 1m 14s —— View job Code Review Complete
Overall AssessmentThe implementation is well-structured and the test coverage is comprehensive. The PR successfully wires up Pretix voucher creation when a grantee confirms, and properly reuses Issues to Address1. External API Call Inside
|
180e3ae to
ae6c392
Compare
|
@claude review |
|
Claude finished @estyxx's task in 1m 34s —— View job Code Review
SummaryThe implementation is well-structured overall. The test coverage is comprehensive and the code successfully wires up Pretix voucher creation when a grantee confirms. Below I've identified issues that should be addressed, including some from the previous review that remain unfixed. Issues to Address1. Task Retry Permanently Drops the Voucher Email (Still Present)File: if conference_voucher:
if conference_voucher.voucher_type in (
ConferenceVoucher.VoucherType.GRANT,
ConferenceVoucher.VoucherType.SPEAKER,
):
logger.info(...)
return # ← Returns without checking voucher_email_sent_atIf Suggested fix: Before returning early, check if if conference_voucher.voucher_type in (...):
if conference_voucher.voucher_email_sent_at is None:
send_conference_voucher_email.delay(conference_voucher_id=conference_voucher.id)
return2. External API Call Inside
|
When a grantee confirms via sendGrantReply, enqueue create_and_send_voucher_to_grantee after transaction.on_commit: create or reuse ConferenceVoucher in Pretix (create_conference_voucher), then send_conference_voucher_email (voucher_code template, same as Voucher admin). Task mirrors schedule voucher flow: skip duplicate Pretix row for existing GRANT/SPEAKER; queue email if voucher_email_sent_at is None (retry after partial success); upgrade CO_SPEAKER to GRANT. Staff resend anytime via Voucher admin Send voucher via email. Admin Create grant vouchers uses create_conference_voucher with prefetched existing rows; no transaction.atomic around Pretix loop. Confirm pending status unchanged. Remove grant_voucher_code email identifier; migration 0022 rewrites rows to voucher_code and documents noop reverse. Tests: GraphQL confirm + on_commit, grant admin vouchers, grant/conference tasks.
afe84a7 to
318c9fb
Compare
When a grantee confirms via
sendGrantReply(status becomesconfirmed), enqueuecreate_and_send_voucher_to_grantee: ensure a GRANTConferenceVoucherin Pretix (create_conference_voucher), then email withsend_conference_voucher_email(same Voucher code template as the conference admin action).Admin: Create grant vouchers uses Pretix creation and co-speaker → grant upgrade. Confirm pending status is unchanged (no vouchers there).
Data: Migration rewrites any
grant_voucher_codeemail templates tovoucher_codeand drops that identifier from choices.Tests: GraphQL confirm path, grant admin voucher action, grant task branches.