diff --git a/InvenTree/InvenTree/forms.py b/InvenTree/InvenTree/forms.py index 47d33e621d..9cfd542d81 100644 --- a/InvenTree/InvenTree/forms.py +++ b/InvenTree/InvenTree/forms.py @@ -13,7 +13,7 @@ from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Field from crispy_forms.bootstrap import PrependedText, AppendedText, PrependedAppendedText, StrictButton, Div -from allauth.account.forms import SignupForm, set_form_field_order +from allauth.account.forms import SignupForm, ResetPasswordForm, set_form_field_order from allauth.account.adapter import DefaultAccountAdapter from allauth.socialaccount.adapter import DefaultSocialAccountAdapter @@ -252,6 +252,15 @@ class CustomSignupForm(SignupForm): return cleaned_data +class CustomResetPasswordForm(ResetPasswordForm): + """ + Override to use dynamic settings + """ + def save(self): + email_address = super().save() + return email_address + + class RegistratonMixin: """ Mixin to check if registration should be enabled diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index a07324ec84..ed018f1f3d 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -676,7 +676,7 @@ ACCOUNT_FORMS = { 'add_email': 'allauth.account.forms.AddEmailForm', 'change_password': 'allauth.account.forms.ChangePasswordForm', 'set_password': 'allauth.account.forms.SetPasswordForm', - 'reset_password': 'allauth.account.forms.ResetPasswordForm', + 'reset_password': 'InvenTree.forms.CustomResetPasswordForm', 'reset_password_from_key': 'allauth.account.forms.ResetPasswordKeyForm', 'disconnect': 'allauth.socialaccount.forms.DisconnectForm', }