mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-02-24 00:59:59 -05:00
no explicit string casting, changed mat2-web started log message
This commit is contained in:
parent
3376158b2c
commit
493626e195
2
main.py
2
main.py
@ -57,7 +57,7 @@ def create_app(test_config=None):
|
|||||||
Swagger(app, template=template, config=swagger_config)
|
Swagger(app, template=template, config=swagger_config)
|
||||||
|
|
||||||
CORS(app, resources={r"/api/*": {"origins": utils.get_allow_origin_header_value()}})
|
CORS(app, resources={r"/api/*": {"origins": utils.get_allow_origin_header_value()}})
|
||||||
app.logger.info('Matweb started')
|
app.logger.info('mat2-web started')
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class APIUpload(Resource):
|
|||||||
try:
|
try:
|
||||||
file_data = base64.b64decode(args['file'])
|
file_data = base64.b64decode(args['file'])
|
||||||
except (binascii.Error, ValueError) as e:
|
except (binascii.Error, ValueError) as e:
|
||||||
current_app.logger.error('Upload - Decoding base64 file %s', str(e))
|
current_app.logger.error('Upload - Decoding base64 file %s', e)
|
||||||
abort(400, message='Failed decoding file')
|
abort(400, message='Failed decoding file')
|
||||||
|
|
||||||
file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name'])
|
file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name'])
|
||||||
@ -169,13 +169,13 @@ class APIBulkDownloadCreator(Resource):
|
|||||||
cleaned_files_zip.write(complete_path)
|
cleaned_files_zip.write(complete_path)
|
||||||
os.remove(complete_path)
|
os.remove(complete_path)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
current_app.logger.error('BulkDownload - Creating archive failed: %s', str(e))
|
current_app.logger.error('BulkDownload - Creating archive failed: %s', e)
|
||||||
abort(400, message='Creating the archive failed')
|
abort(400, message='Creating the archive failed')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cleaned_files_zip.testzip()
|
cleaned_files_zip.testzip()
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
current_app.logger.error('BulkDownload - Validating Zip failed: %s', str(e))
|
current_app.logger.error('BulkDownload - Validating Zip failed: %s', e)
|
||||||
abort(400, message='Validating Zip failed')
|
abort(400, message='Validating Zip failed')
|
||||||
|
|
||||||
parser, mime = utils.get_file_parser(zip_path)
|
parser, mime = utils.get_file_parser(zip_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user