From 1625218c37df95c84dbcea5a0f049ba5f1285850 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 21 Jan 2025 10:40:38 -0600 Subject: 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. --- uploader/files/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'uploader') 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) -- cgit v1.2.3