Commit cf9f6a4f authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Allow to delete uploads before processing.

parent a29a7060
Pipeline #41903 passed with stages
in 14 minutes and 49 seconds
......@@ -186,7 +186,7 @@ class UploadListResource(Resource):
if not upload_files.is_valid:
upload_files.delete()
upload.delete()
upload.delete(force=True)
logger.info('Invalid upload')
abort(400, message='Bad file format, excpected %s.' % ", ".join(upload_files.formats))
......
......@@ -320,8 +320,8 @@ class Upload(Chord, datamodel.Upload):
logger = logger.bind(upload_id=self.upload_id, **kwargs)
return logger
def delete(self):
if not self.completed:
def delete(self, force: bool = False):
if not (self.completed or force):
raise NotAllowedDuringProcessing()
Calc.objects(upload_id=self.upload_id).delete()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment