mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-05-12 11:12:17 -04:00
changed missing file part error message
This commit is contained in:
parent
4642c0079b
commit
8689aa3c31
2 changed files with 8 additions and 3 deletions
|
@ -98,8 +98,10 @@ class APIClean(Resource):
|
||||||
@swag_from('./oas/remove_metadata.yml')
|
@swag_from('./oas/remove_metadata.yml')
|
||||||
def post(self):
|
def post(self):
|
||||||
if 'file' not in request.files:
|
if 'file' not in request.files:
|
||||||
current_app.logger.error('Clean - No file part')
|
current_app.logger.error(
|
||||||
abort(400, message='No file part')
|
'Clean - File part missing: Multipart filename and non-chunked-transfer-encoding required'
|
||||||
|
)
|
||||||
|
abort(400, message='File part missing: Multipart filename and non-chunked-transfer-encoding required')
|
||||||
|
|
||||||
uploaded_file = request.files['file']
|
uploaded_file = request.files['file']
|
||||||
if not uploaded_file.filename:
|
if not uploaded_file.filename:
|
||||||
|
|
|
@ -486,7 +486,10 @@ class Mat2APITestCase(unittest.TestCase):
|
||||||
),
|
),
|
||||||
follow_redirects=False
|
follow_redirects=False
|
||||||
)
|
)
|
||||||
self.assertEqual(r.get_json()['message'], 'No file part')
|
self.assertEqual(
|
||||||
|
r.get_json()['message'],
|
||||||
|
'File part missing: Multipart filename and non-chunked-transfer-encoding required'
|
||||||
|
)
|
||||||
self.assertEqual(r.status_code, 400)
|
self.assertEqual(r.status_code, 400)
|
||||||
|
|
||||||
r = self.app.post(
|
r = self.app.post(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue