Skip to content

Commit 70ffccb

Browse files
committed
Handle expected 204
In case of uploading the problemset we expect a HTTP204 which is not valid JSON and would throw an error by design.
1 parent bf78085 commit 70ffccb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

misc-tools/dj_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def upload_file(name: str, apifilename: str, file: str, data: dict = {}):
147147

148148
result = parse_api_response(name, response)
149149

150+
if response.status_code == 204:
151+
return result
150152
try:
151153
result = json.loads(result)
152154
except json.decoder.JSONDecodeError as e:

0 commit comments

Comments
 (0)