diff --git a/django_etesync/serializers.py b/django_etesync/serializers.py index 5946293..bc04bc0 100644 --- a/django_etesync/serializers.py +++ b/django_etesync/serializers.py @@ -62,8 +62,8 @@ class CollectionContentField(BinaryBase64Field): class ChunksField(serializers.RelatedField): def to_representation(self, obj): - prefer_inline = self.context.get('prefer_inline', False) - if prefer_inline: + inline = self.context.get('inline', False) + if inline: with open(obj.chunkFile.path, 'rb') as f: return (obj.uid, b64encode(f.read())) else: diff --git a/django_etesync/views.py b/django_etesync/views.py index 37de4bb..1c9da78 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -67,8 +67,8 @@ class CollectionViewSet(BaseViewSet): def get_serializer_context(self): context = super().get_serializer_context() - prefer_inline = self.request.method == 'GET' and 'prefer_inline' in self.request.query_params - context.update({'request': self.request, 'prefer_inline': prefer_inline}) + inline = self.request.method == 'GET' and 'inline' in self.request.query_params + context.update({'request': self.request, 'inline': inline}) return context def destroy(self, request, uid=None): @@ -118,8 +118,8 @@ class CollectionItemViewSet(BaseViewSet): def get_serializer_context(self): context = super().get_serializer_context() - prefer_inline = self.request.method == 'GET' and 'prefer_inline' in self.request.query_params - context.update({'request': self.request, 'prefer_inline': prefer_inline}) + inline = self.request.method == 'GET' and 'inline' in self.request.query_params + context.update({'request': self.request, 'inline': inline}) return context def create(self, request, collection_uid=None):