generated from westfarn/web_django_template
Add shopper password reset and extend demo seed for accounts, reviews, and tracking.
CI / test (pull_request) Successful in 39s
CI / test (pull_request) Successful in 39s
Buyers can recover locked accounts, and seed_demo now walks the shopper path without live Stripe or EasyPost calls.
This commit is contained in:
+19
-1
@@ -1,6 +1,11 @@
|
||||
from django import forms
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
|
||||
from django.contrib.auth.forms import (
|
||||
AuthenticationForm,
|
||||
PasswordResetForm,
|
||||
SetPasswordForm,
|
||||
UserCreationForm,
|
||||
)
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from contacts.models import Contact
|
||||
@@ -72,6 +77,19 @@ class CustomerAuthenticationForm(AuthenticationForm):
|
||||
)
|
||||
|
||||
|
||||
class CustomerPasswordResetForm(PasswordResetForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["email"].widget.attrs.update({**_INPUT, "autocomplete": "email"})
|
||||
|
||||
|
||||
class CustomerSetPasswordForm(SetPasswordForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
for field in self.fields.values():
|
||||
field.widget.attrs.update(_INPUT)
|
||||
|
||||
|
||||
class CustomerProfileForm(forms.Form):
|
||||
first_name = forms.CharField(
|
||||
max_length=150,
|
||||
|
||||
Reference in New Issue
Block a user