1
1
from django .templatetags .static import static
2
2
from django import forms
3
3
from django .forms import Select
4
- from django .utils .encoding import force_text
4
+ from django .utils .encoding import force_str
5
5
from django .utils .html import format_html
6
6
from django .utils .safestring import mark_safe
7
7
@@ -49,7 +49,7 @@ def __init__(self, attrs=None, choices=(), **kwargs):
49
49
def render_option (self , selected_choices , option_value , option_label ):
50
50
if option_value is None :
51
51
option_value = ''
52
- option_value = force_text (option_value )
52
+ option_value = force_str (option_value )
53
53
if option_value in selected_choices :
54
54
selected_html = mark_safe (' selected="selected"' )
55
55
if not self .allow_multiple_selected :
@@ -59,10 +59,10 @@ def render_option(self, selected_choices, option_value, option_label):
59
59
selected_html = ''
60
60
61
61
html = '<option value="{}"' .format (option_value )
62
- html += ' data-content="{}"' .format (force_text (option_label ))
62
+ html += ' data-content="{}"' .format (force_str (option_label ))
63
63
if self .attrs .get ('data-live-search' ):
64
64
html += ' data-tokens="{}"' .format (option_value )
65
- html += '{}>{}</option>' .format (selected_html , force_text (option_label ))
65
+ html += '{}>{}</option>' .format (selected_html , force_str (option_label ))
66
66
return format_html (html )
67
67
68
68
# Django 1.11
0 commit comments