mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Fix byte decode error rendering 'display_name' with OPTIONS. Closes #2084
This commit is contained in:
parent
080bd3d24e
commit
c0d356edaa
|
@ -121,7 +121,10 @@ class SimpleMetadata(BaseMetadata):
|
||||||
|
|
||||||
if hasattr(field, 'choices'):
|
if hasattr(field, 'choices'):
|
||||||
field_info['choices'] = [
|
field_info['choices'] = [
|
||||||
{'value': choice_value, 'display_name': choice_name}
|
{
|
||||||
|
'value': choice_value,
|
||||||
|
'display_name': force_text(choice_name, strings_only=True)
|
||||||
|
}
|
||||||
for choice_value, choice_name in field.choices.items()
|
for choice_value, choice_name in field.choices.items()
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user