Fix bug where old image was not saved on AWS

This commit is contained in:
Tobias Eidelpes
2021-01-18 17:26:24 +01:00
parent 6f7936cc4b
commit d500518d8f
3 changed files with 5 additions and 6 deletions
+1 -4
View File
@@ -238,12 +238,9 @@ class ImageEndpoint:
MongoDBService.updateSingle(identifier, decoded_image, metadata)
# TODO TOBIAS get old image for MinIO
old_bytes = None
for service in ImageEndpoint.storageServiceList:
orig_new_name = identifier + '_' + str(metadata['version']) + '.jpg'
if not service.move_file(identifier, orig_new_name, old_bytes):
if not service.move_file(identifier, orig_new_name):
print("Could not move file from {} to {}".format(identifier, orig_new_name))
if not service.create_file(filename, decoded_image):
print("Could not save updated image to " + service.name)