fix: replace get_byte() with get_bytes() for consistency in file handling
This commit is contained in:
parent
758f424000
commit
73ee9bf602
@ -559,6 +559,8 @@ class DocumentSerializers(serializers.Serializer):
|
|||||||
def download_source_file(self):
|
def download_source_file(self):
|
||||||
self.is_valid(raise_exception=True)
|
self.is_valid(raise_exception=True)
|
||||||
file = QuerySet(File).filter(source_id=self.data.get('document_id')).first()
|
file = QuerySet(File).filter(source_id=self.data.get('document_id')).first()
|
||||||
|
if not file:
|
||||||
|
raise AppApiException(500, _('file not exist'))
|
||||||
return FileSerializer.Operate(id=file.id).get(with_valid=True)
|
return FileSerializer.Operate(id=file.id).get(with_valid=True)
|
||||||
|
|
||||||
def one(self, with_valid=False):
|
def one(self, with_valid=False):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user