Skip to content

Commit aa619d0

Browse files
committed
Fix unicode by forcing text in a submit button
1 parent 1352892 commit aa619d0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 0.1.1
44

5+
- Fix unicode by forcing text in a submit button.
56
- Add ability to pass in string path instead of form instance.
67

78
## 0.1.0

formit/templatetags/formit_tags.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from classytags.core import Options
66
from classytags.helpers import InclusionTag
77
from django import template
8+
from django.utils.encoding import smart_text
89
from django.utils.module_loading import import_string
910
from django.utils.six import string_types
1011

@@ -33,7 +34,7 @@ def get_context(self, context, form, attrs):
3334
'action': attrs.get('action', ''),
3435
'method': attrs.get('method', 'get'),
3536
'enctype': attrs.get('enctype', None),
36-
'button': str(attrs.get('button', fs.DEFAULT_BUTTON)),
37+
'button': smart_text(attrs.get('button', fs.DEFAULT_BUTTON)),
3738
'novalidate': 'novalidate' in flags or fs.DEFAULT_NOVALIDATE,
3839
'show_csrf_token': 'hide_csrf_token' not in flags,
3940
'show_non_field_errors': 'hide_non_field_errors' not in flags,

0 commit comments

Comments
 (0)