-
Notifications
You must be signed in to change notification settings - Fork 39
Proxy label can't be decoded #105
Comments
That's unfortunate. Let me check it. Upon closer investigation, @nypisces there is already a check in place to make sure what we are decoding isn't |
Hello, @limdauto, i have same issue with field "password" in custom django user model. Last exception line is: And value of label is (and you are right, it is a translation object):
You can reproduce this issue by setting converting
|
Sure, this happens because the model fields use |
I made the change that joeribekker suggested and it works. I haven't tested it on all the different platforms though, so I didn't make a pull request. |
I ran into this issue on a project, and used @alantrick's edit to fix it (Thanks! 😄). Throwing up a PR to try and get this in quickly so we can stop depending on a fork. |
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/drf_openapi/entities.py", line 298, in fallback_schema_from_field
title = force_text(field.label) if field.label else ''
File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/coreapi/compat.py", line 50, in force_text
return string.decode('utf-8')
AttributeError: 'proxy' object has no attribute 'decode'
python3 str no decode
The text was updated successfully, but these errors were encountered: