Merge pull request #1879 from last-partizan/fix-choices-display
fixed TypeError on translated choices
This commit is contained in:
commit
5c805be067
@ -1091,6 +1091,6 @@ class BaseDocument(object):
|
|||||||
sep = getattr(field, 'display_sep', ' ')
|
sep = getattr(field, 'display_sep', ' ')
|
||||||
values = value if field.__class__.__name__ in ('ListField', 'SortedListField') else [value]
|
values = value if field.__class__.__name__ in ('ListField', 'SortedListField') else [value]
|
||||||
return sep.join([
|
return sep.join([
|
||||||
dict(field.choices).get(val, val)
|
six.text_type(dict(field.choices).get(val, val))
|
||||||
for val in values or []])
|
for val in values or []])
|
||||||
return value
|
return value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user