Skip to content

Commit

Permalink
Use allauth option not custom form to not require double password entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
fsargent committed Jul 25, 2024
1 parent b536cc7 commit 01605d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions approval_polls/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,3 @@ def clean(self):
else:
msg = "This field is required."
self.add_error("zipcode", msg)


class CustomSignupForm(SignupForm):
def __init__(self, *args, **kwargs):
super(CustomSignupForm, self).__init__(*args, **kwargs)
del self.fields["password2"]

def save(self, request):
# Ensure you don't need to use password2 in the save method
user = super(CustomSignupForm, self).save(request)
return user
2 changes: 1 addition & 1 deletion approval_polls/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,4 @@
ACCOUNT_DEFAULT_HTTP_PROTOCOL = env(
"ACCOUNT_DEFAULT_HTTP_PROTOCOL", str, default="https"
)
ACCOUNT_FORMS = {"signup": "approval_polls.forms.CustomSignupForm"}
ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = False

0 comments on commit 01605d0

Please sign in to comment.