Skip to content

Commit

Permalink
refactor(headless): Use ACCOUNT_FORMS setting for RequestPasswordRese…
Browse files Browse the repository at this point in the history
…tInput
  • Loading branch information
mecampbellsoup committed Aug 12, 2024
1 parent 9440c0a commit 8890264
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion allauth/account/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def clean_email(self, email):
def clean_password(self, password, user=None):
"""
Validates a password. You can hook into this if you want to
restric the allowed password choices.
restrict the allowed password choices.
"""
min_length = app_settings.PASSWORD_MIN_LENGTH
if min_length:
Expand Down
11 changes: 10 additions & 1 deletion allauth/headless/account/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ def clean_key(self):
return confirmation


class RequestPasswordResetInput(ResetPasswordForm, inputs.Input):
from allauth.utils import get_form_class


def _reset_password_form_class():
return get_form_class(
account_app_settings.FORMS, "reset_password", ResetPasswordForm
)


class RequestPasswordResetInput(_reset_password_form_class(), inputs.Input):
pass


Expand Down

0 comments on commit 8890264

Please sign in to comment.