From 2e018dfe7672e6fd4813c410f0f0e386b392ead8 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 15 Apr 2020 16:47:31 +0300 Subject: [PATCH] Rename prefer_inline to inline. --- django_etesync/serializers.py | 4 ++-- django_etesync/views.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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):