Close version file object using a context manager
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -329,8 +329,8 @@ class DocumentVersion(models.Model):
|
|||||||
Save a copy of the document from the document storage backend
|
Save a copy of the document from the document storage backend
|
||||||
to the local filesystem
|
to the local filesystem
|
||||||
"""
|
"""
|
||||||
input_file_object = self.open()
|
with self.open() as input_file_object:
|
||||||
shutil.copyfileobj(fsrc=input_file_object, fdst=file_object)
|
shutil.copyfileobj(fsrc=input_file_object, fdst=file_object)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def size(self):
|
def size(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user