Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
I have a ModelSerializer for the django-taggit package's Tag model. With DRF release 3.3.1 it began failing with AttributeError: 'TaggableManager' object has no attribute 'to_fields'.
AttributeError: 'TaggableManager' object has no attribute 'to_fields'
I believe this line from PR 3526 assumes all relation fields have a to_fields attribute, but taggit's TaggableManager is an example of one that doesn't.
Replacing it with
return field.to_fields if hasattr(field, 'to_fields') else None
seems to solve the problem.
The text was updated successfully, but these errors were encountered:
Seems sensible to me.
Sorry, something went wrong.
@martinhill wan't to put a PR together with your proposed changes?
be happy to!
fix for issue encode#3634
No branches or pull requests