vintasoftware / drf-rw-serializers

Generic views, viewsets and mixins that extend the Django REST Framework ones adding separated serializers for read and write operations
MIT License
177 stars 28 forks source link

use read_serializer in get_success_headers call #2

Closed guglielmo closed 5 years ago

guglielmo commented 6 years ago

Description: This avoids an error during the computation of write_serializer.data when the object to be serialized contains a field which is a GenericRelation.

The error states that 'url' is not a field of the GenericRelation, which may be true because the field it's only in my read_serializer and not in the write_serializer (I am not needing it).

Author concerns: It's a quick and dirty fix, but what's the difference between the two serializers for this particular part of DRF?

hugobessa commented 5 years ago

Sorry for the delay @guglielmo. The building wasn't passing for some reason, but I ran it again and it worked ¯_(ツ)_/¯

I'll release and upload a new version to pypi