Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use smart_text for error display.

Marco Badan9a8998fae7e8
diff --git a/saleor/discount/forms.py b/saleor/discount/forms.py
index 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_text
from django.utils.translation import pgettext_lazy
from .models import Voucher, NotApplicable
@@ -39,7 +39,7 @@ class CheckoutDiscountForm(forms.Form):
discount = voucher.get_discount_for_checkout(self.checkout)
cleaned_data['discount'] = discount
except NotApplicable as e:
- self.add_error('voucher', six.text_type(e))
+ self.add_error('voucher', smart_text(e))
return cleaned_data
def apply_discount(self):