You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'.
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[0] if hasattr(field, 'to_fields') else None