Added full version delete for image

This commit is contained in:
Martin Schett 2021-01-19 18:59:29 +01:00
parent 94f7f2182e
commit 51e1da30e1

View File

@ -198,6 +198,7 @@ class ImageEndpoint:
logger.debug('Image DELETE single call: {}'.format(request))
result_bool = True
while identifier is not None:
# get metadata from MongoDB
metadata = MongoDBService.getSingle(identifier)
@ -213,6 +214,12 @@ class ImageEndpoint:
print('Error deleting file in ' + service.name)
result_bool = False
identifier = None
if 'previous' in metadata:
identifier = metadata['previous']
if identifier == '':
identifier = None
return JsonResponse({'Result': result_bool}, safe=False)
@staticmethod