diff options
| -rw-r--r-- | main.py | 2 | ||||
| -rw-r--r-- | matweb/rest_api.py | 6 |
2 files changed, 4 insertions, 4 deletions
| @@ -57,7 +57,7 @@ def create_app(test_config=None): | |||
| 57 | Swagger(app, template=template, config=swagger_config) | 57 | Swagger(app, template=template, config=swagger_config) |
| 58 | 58 | ||
| 59 | CORS(app, resources={r"/api/*": {"origins": utils.get_allow_origin_header_value()}}) | 59 | CORS(app, resources={r"/api/*": {"origins": utils.get_allow_origin_header_value()}}) |
| 60 | app.logger.info('Matweb started') | 60 | app.logger.info('mat2-web started') |
| 61 | return app | 61 | return app |
| 62 | 62 | ||
| 63 | 63 | ||
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): | |||
| 31 | try: | 31 | try: |
| 32 | file_data = base64.b64decode(args['file']) | 32 | file_data = base64.b64decode(args['file']) |
| 33 | except (binascii.Error, ValueError) as e: | 33 | except (binascii.Error, ValueError) as e: |
| 34 | current_app.logger.error('Upload - Decoding base64 file %s', str(e)) | 34 | current_app.logger.error('Upload - Decoding base64 file %s', e) |
| 35 | abort(400, message='Failed decoding file') | 35 | abort(400, message='Failed decoding file') |
| 36 | 36 | ||
| 37 | file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name']) | 37 | file = FileStorage(stream=io.BytesIO(file_data), filename=args['file_name']) |
| @@ -169,13 +169,13 @@ class APIBulkDownloadCreator(Resource): | |||
| 169 | cleaned_files_zip.write(complete_path) | 169 | cleaned_files_zip.write(complete_path) |
| 170 | os.remove(complete_path) | 170 | os.remove(complete_path) |
| 171 | except ValueError as e: | 171 | except ValueError as e: |
| 172 | current_app.logger.error('BulkDownload - Creating archive failed: %s', str(e)) | 172 | current_app.logger.error('BulkDownload - Creating archive failed: %s', e) |
| 173 | abort(400, message='Creating the archive failed') | 173 | abort(400, message='Creating the archive failed') |
| 174 | 174 | ||
| 175 | try: | 175 | try: |
| 176 | cleaned_files_zip.testzip() | 176 | cleaned_files_zip.testzip() |
| 177 | except ValueError as e: | 177 | except ValueError as e: |
| 178 | current_app.logger.error('BulkDownload - Validating Zip failed: %s', str(e)) | 178 | current_app.logger.error('BulkDownload - Validating Zip failed: %s', e) |
| 179 | abort(400, message='Validating Zip failed') | 179 | abort(400, message='Validating Zip failed') |
| 180 | 180 | ||
| 181 | parser, mime = utils.get_file_parser(zip_path) | 181 | parser, mime = utils.get_file_parser(zip_path) |
