aboutsummaryrefslogtreecommitdiffstats
path: root/opnfv_testapi/resources
diff options
context:
space:
mode:
Diffstat (limited to 'opnfv_testapi/resources')
-rw-r--r--opnfv_testapi/resources/result_handlers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/opnfv_testapi/resources/result_handlers.py b/opnfv_testapi/resources/result_handlers.py
index bb1b488..ad0b37c 100644
--- a/opnfv_testapi/resources/result_handlers.py
+++ b/opnfv_testapi/resources/result_handlers.py
@@ -403,6 +403,10 @@ class ResultsFileUploadHandler(ResultsCLHandler):
if not input_token or not input_token == token:
raises.Unauthorized(message.invalid_token())
file_array = self.request.files.get('file', None)
+ if file_array is None:
+ msg = 'Please upload a file.'
+ self.finish_request({'code': 403, 'msg': msg})
+ return
fileinfo = file_array[0]
try:
tar_in = tarfile.open(fileobj=io.BytesIO(fileinfo['body']),