Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add support for Python 3
Marcin Gębala0a2b336ba47b
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.pyindex f977284376..f96c053390 100644--- a/saleor/dashboard/order/views.py+++ b/saleor/dashboard/order/views.py@@ -92,7 +92,7 @@ class OrderDetails(StaffMemberOnlyMixin, DetailView):if payment.status == 'preauth':try:payment.release(user=self.request.user)- except PaymentError, e:+ except PaymentError as e:error_msg = _('Payment gateway error: ') + e.messagemessages.error(self.request, error_msg)else:@@ -107,7 +107,7 @@ class OrderDetails(StaffMemberOnlyMixin, DetailView):payment.capture(amount=form.cleaned_data['amount'],user=self.request.user)- except PaymentError, e:+ except PaymentError as e:error_msg = _('Payment gateway error: ') + e.messageelse:messages.success(self.request, _('Funds captured'))@@ -117,7 +117,7 @@ class OrderDetails(StaffMemberOnlyMixin, DetailView):payment.refund(amount=form.cleaned_data['amount'],user=self.request.user)- except PaymentError, e:+ except PaymentError as e:error_msg = _('Payment gateway error: ') + e.messageelse:messages.success(self.request, _('Refund successful'))diff --git a/saleor/dashboard/payments/views.py b/saleor/dashboard/payments/views.pyindex 2d7bf72cd5..27c8053ca3 100644--- a/saleor/dashboard/payments/views.py+++ b/saleor/dashboard/payments/views.py@@ -51,7 +51,7 @@ class PaymentDetails(DetailView):if form.is_valid():try:payment.capture(amount=form.cleaned_data['amount'])- except PaymentError, e:+ except PaymentError as e:error_msg = _('Payment gateway error: ') + e.messageelse:messages.success(self.request, _('Funds captured'))@@ -59,7 +59,7 @@ class PaymentDetails(DetailView):if 'refund' in self.request.POST and payment.status == 'confirmed':try:payment.refund(amount=payment.captured_amount)- except PaymentError, e:+ except PaymentError as e:error_msg = _('Payment gateway error: ') + e.messageelse:messages.success(self.request, _('Refund successful'))@@ -67,7 +67,7 @@ class PaymentDetails(DetailView):if 'release' in self.request.POST and payment.status == 'preauth':try:payment.release()- except PaymentError, e:+ except PaymentError as e:error_msg = _('Payment gateway error: ') + e.messageelse:messages.success(self.request, _('Release successful'))diff --git a/saleor/dashboard/urls.py b/saleor/dashboard/urls.pyindex 987ca72a70..796c8babb5 100644--- a/saleor/dashboard/urls.py+++ b/saleor/dashboard/urls.py@@ -1,10 +1,10 @@from django.conf.urls import patterns, url, includefrom . import views as core_views-from order.urls import urlpatterns as order_urls-from product.urls import urlpatterns as product_urls-from payments.urls import urlpatterns as payments_urls-from customer.urls import urlpatterns as customer_urls+from .order.urls import urlpatterns as order_urls+from .product.urls import urlpatterns as product_urls+from .payments.urls import urlpatterns as payments_urls+from .customer.urls import urlpatterns as customer_urlsurlpatterns = patterns('',