From 493626e1953b0ad79f1298e054c687aff8936aeb Mon Sep 17 00:00:00 2001 From: Jan Friedli Date: Thu, 3 Sep 2020 20:49:04 +0200 Subject: no explicit string casting, changed mat2-web started log message --- main.py | 2 +- matweb/rest_api.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ea027c7..9380323 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ def create_app(test_config=None): Swagger(app, template=template, config=swagger_config) 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 diff --git a/matweb/rest_api.py b/matweb/rest_api.py index 1e7f9fd..d3d9d8f 100644 --- a/matweb/rest_api.py +++ b/matweb/rest_api.py @@ -31,7 +31,7 @@ class APIUpload(Resource): try: file_data = base64.b64decode(args['file']) 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') file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name']) @@ -169,13 +169,13 @@ class APIBulkDownloadCreator(Resource): cleaned_files_zip.write(complete_path) os.remove(complete_path) 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') try: cleaned_files_zip.testzip() 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') parser, mime = utils.get_file_parser(zip_path) -- cgit v1.3