Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use smart_text for error display.
Marco Badan9a8998fae7e8
diff --git a/saleor/discount/forms.py b/saleor/discount/forms.pyindex fb1920e03e..c956696c97 100644--- a/saleor/discount/forms.py+++ b/saleor/discount/forms.py@@ -1,5 +1,5 @@from django import forms-from django.utils import six+from django.utils.encoding import smart_textfrom django.utils.translation import pgettext_lazyfrom .models import Voucher, NotApplicable@@ -39,7 +39,7 @@ class CheckoutDiscountForm(forms.Form):discount = voucher.get_discount_for_checkout(self.checkout)cleaned_data['discount'] = discountexcept NotApplicable as e:- self.add_error('voucher', six.text_type(e))+ self.add_error('voucher', smart_text(e))return cleaned_datadef apply_discount(self):