From 88902649f8b59ff10e3a5bca1e26dda940528823 Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Mon, 12 Aug 2024 15:28:56 -0400 Subject: [PATCH] refactor(headless): Use ACCOUNT_FORMS setting for RequestPasswordResetInput --- allauth/account/adapter.py | 2 +- allauth/headless/account/inputs.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/allauth/account/adapter.py b/allauth/account/adapter.py index 5583b184d4..4cda41ec60 100644 --- a/allauth/account/adapter.py +++ b/allauth/account/adapter.py @@ -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: diff --git a/allauth/headless/account/inputs.py b/allauth/headless/account/inputs.py index 18531e1019..1b5ea59694 100644 --- a/allauth/headless/account/inputs.py +++ b/allauth/headless/account/inputs.py @@ -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