Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove unused PasswordSetUpForm
Anna Siwikfd6ea4f041d2
diff --git a/saleor/registration/forms.py b/saleor/registration/forms.pyindex 17a9017ca7..07ec4373a7 100644--- a/saleor/registration/forms.py+++ b/saleor/registration/forms.py@@ -1,6 +1,5 @@from django import formsfrom django.contrib.auth import forms as django_forms-from django.http.request import HttpRequestfrom django.urls import reversefrom django.utils.translation import pgettext, pgettext_lazyfrom templated_email import send_templated_mail@@ -49,29 +48,6 @@ class SignupForm(forms.ModelForm):return user-class PasswordSetUpForm(django_forms.PasswordResetForm):- """- PasswordSetUpForm that overrides sending emails to use templated email.- Allows setting password for new users that have no usable password.- """-- def get_users(self, email):- active_users = User.objects.filter(email__iexact=email, is_active=True)- return active_users-- def send_mail(- self, subject_template_name, email_template_name, context,- from_email, to_email, html_email_template_name=None):- reset_url = HttpRequest.build_absolute_uri(- reverse(- 'account_reset_password_confirm',- kwargs={'uidb64': context['uid'], 'token': context['token']}))- context['reset_url'] = reset_url- send_templated_mail(- 'account/password_set', from_email=from_email,- recipient_list=[to_email], context=context)--class PasswordResetForm(django_forms.PasswordResetForm):"""PasswordResetForm that overrides sending emails to use templated email."""diff --git a/saleor/registration/views.py b/saleor/registration/views.pyindex 44f203cf58..140799d1f7 100644--- a/saleor/registration/views.py+++ b/saleor/registration/views.py@@ -8,7 +8,7 @@ from django.urls import reverse_lazyfrom django.utils.translation import ugettext_lazy as _from ..cart.utils import find_and_assign_anonymous_cart-from .forms import LoginForm, PasswordResetForm, PasswordSetUpForm, SignupForm+from .forms import LoginForm, PasswordResetForm, SignupForm@find_and_assign_anonymous_cart()@@ -54,7 +54,6 @@ def password_reset(request):class PasswordResetConfirm(django_views.PasswordResetConfirmView):template_name = 'account/password_reset_from_key.html'success_url = reverse_lazy('account_reset_password_complete')- set_password_form = PasswordSetUpFormtoken = Noneuidb64 = None@@ -63,8 +62,6 @@ def password_reset_confirm(request, uidb64=None, token=None):kwargs = {'template_name': 'account/password_reset_from_key.html','success_url': reverse_lazy('account_reset_password_complete'),- 'set_password_form': 'PasswordSetUpForm','token': token,'uidb64': uidb64}- return PasswordResetConfirm.as_view(**kwargs)(- request, **kwargs)+ return PasswordResetConfirm.as_view(**kwargs)(request, **kwargs)