aboutsummaryrefslogtreecommitdiff
path: root/uploader
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-01-21 10:40:38 -0600
committerFrederick Muriuki Muriithi2025-01-21 10:40:38 -0600
commit1625218c37df95c84dbcea5a0f049ba5f1285850 (patch)
treef99f34f9ba8b88f5a0bc8bec9dec794bb67bad44 /uploader
parent1d25a952fac545c5814a3ab9bac087f572248588 (diff)
downloadgn-uploader-1625218c37df95c84dbcea5a0f049ba5f1285850.tar.gz
Return a 201 status message when a chunk is uploaded
Status 201 is returned for when a chunk is uploaded successfully, but the entire file is incomplete.
Diffstat (limited to 'uploader')
-rw-r--r--uploader/files/views.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/uploader/files/views.py b/uploader/files/views.py
index 7d39cee..06481ee 100644
--- a/uploader/files/views.py
+++ b/uploader/files/views.py
@@ -84,10 +84,9 @@ def resumable_upload_post():
"statuscode": 200
}), 200
return jsonify({
- "message": "Some chunks were not uploaded!",
- "error": "ChunksUploadError",
- "error-description": "Some chunks were not uploaded!"
- })
+ "message": f"Chunk {int(_chunk)} uploaded successfully.",
+ "statuscode": 201
+ }), 201
except Exception as exc:# pylint: disable=[broad-except]
msg = "Error processing uploaded file chunks."
app.logger.error(msg, exc_info=True, stack_info=True)