mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +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.layout import Layout, Field
|
||||||
from crispy_forms.bootstrap import PrependedText, AppendedText, PrependedAppendedText, StrictButton, Div
|
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.account.adapter import DefaultAccountAdapter
|
||||||
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
|
||||||
|
|
||||||
@ -252,6 +252,15 @@ class CustomSignupForm(SignupForm):
|
|||||||
return cleaned_data
|
return cleaned_data
|
||||||
|
|
||||||
|
|
||||||
|
class CustomResetPasswordForm(ResetPasswordForm):
|
||||||
|
"""
|
||||||
|
Override to use dynamic settings
|
||||||
|
"""
|
||||||
|
def save(self):
|
||||||
|
email_address = super().save()
|
||||||
|
return email_address
|
||||||
|
|
||||||
|
|
||||||
class RegistratonMixin:
|
class RegistratonMixin:
|
||||||
"""
|
"""
|
||||||
Mixin to check if registration should be enabled
|
Mixin to check if registration should be enabled
|
||||||
|
@ -676,7 +676,7 @@ ACCOUNT_FORMS = {
|
|||||||
'add_email': 'allauth.account.forms.AddEmailForm',
|
'add_email': 'allauth.account.forms.AddEmailForm',
|
||||||
'change_password': 'allauth.account.forms.ChangePasswordForm',
|
'change_password': 'allauth.account.forms.ChangePasswordForm',
|
||||||
'set_password': 'allauth.account.forms.SetPasswordForm',
|
'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',
|
'reset_password_from_key': 'allauth.account.forms.ResetPasswordKeyForm',
|
||||||
'disconnect': 'allauth.socialaccount.forms.DisconnectForm',
|
'disconnect': 'allauth.socialaccount.forms.DisconnectForm',
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user