catch no bulk post body

This commit is contained in:
Jan Friedli 2020-07-14 22:49:24 +02:00
parent 5d1e6b3235
commit 2ba8d74fa7
No known key found for this signature in database
GPG key ID: F945FA2FCA30549D
2 changed files with 10 additions and 0 deletions

View file

@ -106,6 +106,8 @@ class APIBulkDownloadCreator(Resource):
def post(self):
utils.check_upload_folder(current_app.config['UPLOAD_FOLDER'])
data = request.json
if not data:
abort(400, message="Post Body Required")
if not self.v.validate(data):
abort(400, message=self.v.errors)
# prevent the zip file from being overwritten