feat: implement Story 4.1 - Access Registration Page
Allows potential participants to view exchange details and access the registration form via unique slug URLs. Implementation: - Added ParticipantRegistrationForm with name, email, gift_ideas, and reminder fields - Created GET /exchange/<slug>/register route - Built responsive registration template with exchange details - Exempted participant routes from admin setup requirement - Comprehensive test coverage for all scenarios Acceptance Criteria Met: - Valid slug displays registration form with exchange details - Invalid slug returns 404 - Form includes all required fields with CSRF protection - Registration deadline is displayed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from src.forms.exchange import ExchangeForm
|
||||
from src.forms.login import LoginForm
|
||||
from src.forms.participant import ParticipantRegistrationForm
|
||||
from src.forms.setup import SetupForm
|
||||
|
||||
__all__ = ["ExchangeForm", "LoginForm", "SetupForm"]
|
||||
__all__ = ["ExchangeForm", "LoginForm", "ParticipantRegistrationForm", "SetupForm"]
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
"""Forms for participant registration and management."""
|
||||
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import BooleanField, EmailField, StringField, TextAreaField
|
||||
from wtforms.validators import DataRequired, Email, Length
|
||||
|
||||
|
||||
class ParticipantRegistrationForm(FlaskForm):
|
||||
"""Form for participant registration."""
|
||||
|
||||
name = StringField(
|
||||
"Name",
|
||||
validators=[
|
||||
DataRequired(message="Name is required"),
|
||||
Length(max=255, message="Name must be less than 255 characters"),
|
||||
],
|
||||
)
|
||||
|
||||
email = EmailField(
|
||||
"Email",
|
||||
validators=[
|
||||
DataRequired(message="Email is required"),
|
||||
Email(message="Please enter a valid email address"),
|
||||
Length(max=255, message="Email must be less than 255 characters"),
|
||||
],
|
||||
)
|
||||
|
||||
gift_ideas = TextAreaField(
|
||||
"Gift Ideas",
|
||||
description="Optional: Share ideas to help your Secret Santa",
|
||||
)
|
||||
|
||||
reminder_enabled = BooleanField(
|
||||
"Send me reminders",
|
||||
default=True,
|
||||
description="Receive email reminders about important dates",
|
||||
)
|
||||
Reference in New Issue
Block a user