mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
custom reset form
This commit is contained in:
parent
f89dd84daf
commit
8ef07dcf61
@ -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
|
||||
|
@ -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',
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user