Fix bug where old image was not saved on AWS
This commit is contained in:
@@ -70,7 +70,7 @@ class DropboxService(StorageServiceInterface):
|
||||
return file_bytes
|
||||
|
||||
@staticmethod
|
||||
def move_file(identifier_from: str, identifier_to: str, file: bytes = None) -> bool:
|
||||
def move_file(identifier_from: str, identifier_to: str) -> bool:
|
||||
"""Move/Rename a file on the dropbox storage.
|
||||
|
||||
:param identifier_from: Location of the file to be moved
|
||||
|
||||
@@ -66,7 +66,7 @@ class MinioService(StorageServiceInterface):
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def move_file(identifier_from: str, identifier_to: str, file: bytes) -> bool:
|
||||
def move_file(identifier_from: str, identifier_to: str) -> bool:
|
||||
"""Move/Rename a file on the S3 storage.
|
||||
|
||||
Consists of a PUT method (copying the object) and a delete method.
|
||||
@@ -79,6 +79,8 @@ class MinioService(StorageServiceInterface):
|
||||
filename_from = identifier_from + '.jpg'
|
||||
filename_to = identifier_to
|
||||
|
||||
file = MinioService.read_file(filename_from)
|
||||
|
||||
if not MinioService.delete_file(filename_from):
|
||||
print("MinioService: Updating (delete) file {} failed".format(filename_from))
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user