From 7f3adf39e586f970cc2d9aebec50f5461a923e81 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 15 Jan 2025 16:52:56 -0600 Subject: If file already exists, return success rather than failing. If user has already uploaded the file, simply return success, rather than failing. --- uploader/files/views.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'uploader') diff --git a/uploader/files/views.py b/uploader/files/views.py index cd5f00f..76ac212 100644 --- a/uploader/files/views.py +++ b/uploader/files/views.py @@ -56,12 +56,10 @@ def resumable_upload_post(): if _targetfile.exists(): return jsonify({ - "message": ( - "A file with a similar unique identifier has previously been " - "uploaded and possibly is/has being/been processed."), - "error": "BadRequest", - "statuscode": 400 - }), 400 + "uploaded-file": _targetfile.name, + "message": "File was uploaded successfully!", + "statuscode": 200 + }), 200 try: chunks_directory(_fileid).mkdir(exist_ok=True, parents=True) -- cgit v1.2.3