Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Don't override class based view. Wrap function in a decorator
Artur Smęt9abcaacd9c63
diff --git a/saleor/userprofile/views.py b/saleor/userprofile/views.pyindex dd1ac2c48d..a794b8e9bd 100755--- a/saleor/userprofile/views.py+++ b/saleor/userprofile/views.py@@ -1,5 +1,5 @@from allauth.account.adapter import get_adapter-from allauth.account.views import LoginView as AllauthLoginView+from allauth.account.views import login as allauth_loginfrom allauth.account.forms import ChangePasswordFormfrom allauth.account.utils import logout_on_password_changefrom django.contrib import messages@@ -8,7 +8,6 @@ from django.core.urlresolvers import reversefrom django.http import HttpResponseRedirectfrom django.shortcuts import get_object_or_404from django.template.response import TemplateResponse-from django.utils.decorators import method_decoratorfrom django.utils.translation import ugettext as _from ..cart.utils import find_and_assign_anonymous_cartfrom .forms import ChangePasswordForm, get_address_form@@ -62,9 +61,4 @@ def address_delete(request, pk):request, 'userprofile/address-delete.html', {'address': address})-class LoginView(AllauthLoginView):- @method_decorator(find_and_assign_anonymous_cart())- def dispatch(self, *args, **kwargs):- super(LoginView, self).dispatch(*args, **kwargs)--login = LoginView.as_view()+login = find_and_assign_anonymous_cart()(allauth_login)