diff options
author | Frederick Muriuki Muriithi | 2025-01-15 16:52:56 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-01-15 16:52:56 -0600 |
commit | 7f3adf39e586f970cc2d9aebec50f5461a923e81 (patch) | |
tree | 12eb2db2712ed0d4fd16e744053055c7c1a38645 /uploader | |
parent | d6b72265d0bc11575eddc88c8b017803e07aec79 (diff) | |
download | gn-uploader-7f3adf39e586f970cc2d9aebec50f5461a923e81.tar.gz |
If file already exists, return success rather than failing.
If user has already uploaded the file, simply return success, rather
than failing.
Diffstat (limited to 'uploader')
-rw-r--r-- | uploader/files/views.py | 10 |
1 files changed, 4 insertions, 6 deletions
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) |