remove unneeded override

This commit is contained in:
Matthias 2021-09-07 22:38:01 +02:00
parent dbc58b299c
commit b281241607
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 2 additions and 31 deletions

View File

@ -37,7 +37,7 @@ from rest_framework.documentation import include_docs_urls
from .views import auth_request
from .views import IndexView, SearchView, DatabaseStatsView
from .views import SettingsView, EditUserView, SetPasswordView, CustomEmailView, CustomConnectionsView, CustomPasswordChangeView, CustomPasswordResetFromKeyView
from .views import SettingsView, EditUserView, SetPasswordView, CustomEmailView, CustomConnectionsView, CustomPasswordResetFromKeyView
from .views import CurrencyRefreshView
from .views import AppearanceSelectView, SettingCategorySelectView
from .views import DynamicJsView
@ -166,7 +166,6 @@ urlpatterns = [
# overrides of urlpatterns
url(r'^accounts/email/', CustomEmailView.as_view(), name='account_email'),
url(r'^accounts/social/connections/', CustomConnectionsView.as_view(), name='socialaccount_connections'),
url(r'^accounts/password/change/', CustomPasswordChangeView.as_view(), name='account_change_password'),
url(r"^accounts/password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$", CustomPasswordResetFromKeyView.as_view(), name="account_reset_password_from_key"),
url(r'^accounts/', include('allauth.urls')), # included urlpatterns
]

View File

@ -27,7 +27,7 @@ from djmoney.contrib.exchange.models import ExchangeBackend, Rate
from allauth.account.forms import AddEmailForm
from allauth.socialaccount.forms import DisconnectForm
from allauth.account.models import EmailAddress
from allauth.account.views import EmailView, PasswordChangeView, PasswordResetFromKeyView
from allauth.account.views import EmailView, PasswordResetFromKeyView
from allauth.socialaccount.views import ConnectionsView
from common.settings import currency_code_default, currency_codes
@ -850,13 +850,6 @@ class CustomConnectionsView(AllauthOverrides, ConnectionsView):
success_url = reverse_lazy("settings")
class CustomPasswordChangeView(LoginRequiredMixin, PasswordChangeView):
"""
Override of allauths PasswordChangeView to always show the settings but leave the functions allow
"""
success_url = reverse_lazy("login")
class CustomPasswordResetFromKeyView(PasswordResetFromKeyView):
"""
Override of allauths PasswordResetFromKeyView to always show the settings but leave the functions allow

View File

@ -1,21 +0,0 @@
{% extends "account/base.html" %}
{% load i18n crispy_forms_tags inventree_extras %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block content %}
{% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %}
<h1>{% trans "Change Password" %}</h1>
<form method="POST" action="{% url 'account_change_password' %}" class="password_change">
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary" name="action">{% trans "Change Password" %}</button>
{% if enable_pwd_forgot %}
<a href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
{% endif %}
</form>
{% endblock %}