Skip to content

Commit

Permalink
added decode to check file is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorsch committed Feb 13, 2024
1 parent 610d4a9 commit fddfd3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compute/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ def submit_job_upload():
error = jsonify(description="Failed to submit job file", error='No batch file selected')
return error, 400

if job_file['content'] == '':
# decoding content, since from read() method it returns binary encoding
if job_file['content'].decode() == '':
app.logger.error('Batch file is empty')
error = jsonify(description="Failed to submit job file", error='Batch file is empty')
return error, 400
Expand Down

0 comments on commit fddfd3b

Please sign in to comment.