Files
print_forge/site/public/forms.py
T
westfarn c9b81ceed7
CI / test (pull_request) Successful in 35s
Add customer accounts, shipment tracking, and purchase reviews.
Shoppers can register, save shipping details, and view order history while cards stay on Stripe. EasyPost tracker updates (including numbers from Pirate Ship) and 1–5 star reviews are limited to buyers. The contact form now only asks for email and a message.
2026-09-07 06:37:52 -05:00

38 lines
1.2 KiB
Python

from django import forms
from django.conf import settings
class ContactForm(forms.Form):
INTEREST_CHOICES = [
("general", "General inquiry"),
("custom", "Custom toy / print"),
("order", "Order question"),
("wholesale", "Wholesale"),
("other", "Something else"),
]
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-input", "id": "contact-email"}),
)
interest = forms.ChoiceField(
choices=INTEREST_CHOICES,
widget=forms.Select(attrs={"class": "form-input", "id": "contact-interest"}),
)
message = forms.CharField(
widget=forms.Textarea(attrs={"class": "form-input", "id": "contact-message"}),
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if settings.RECAPTCHA_PUBLIC_KEY and settings.RECAPTCHA_PRIVATE_KEY:
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV3
self.fields["captcha"] = ReCaptchaField(widget=ReCaptchaV3)
class NotifyForm(forms.Form):
email = forms.EmailField(
widget=forms.EmailInput(attrs={"class": "form-input"}),
)