05b7397687f15dba5b54085aa1542b0b1fc1e0a6
Extract duplicated waitlist logic into two reusable abstractions: 1. @waitlist_gate(template, **context) decorator - Intercepts GET requests when WAITLIST_MODE=true - Passes through POST requests for form handling - Evaluates callable context at request time 2. capture_waitlist_email(email, intent, plan, email_intent) helper - Idempotent DB insertion (INSERT OR IGNORE) - Enqueues confirmation email only for new signups - Adds to Resend audience with silent error handling - Supports separate email_intent for supplier messaging Applied to auth, suppliers, and planner routes, reducing ~80+ lines of duplicated code. Added comprehensive tests (55 total, all passing) and documentation (25KB guide in docs/WAITLIST.md). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Description
No description provided
Languages
HTML
46.4%
Python
43.3%
JavaScript
4.6%
Jinja
2.3%
CSS
2.2%
Other
1.2%