mirror of
https://0xacab.org/jvoisin/mat2-web.git
synced 2025-07-27 16:35:20 -04:00
Bugfix catch attribute errors and updated dependencies
This commit is contained in:
parent
8689aa3c31
commit
71b00c2098
7 changed files with 491 additions and 816 deletions
|
@ -86,7 +86,7 @@ def upload_file():
|
|||
download_uri=url_for('routes.download_file', key=key, secret=secret, filename=output_filename),
|
||||
meta_after=meta_after,
|
||||
)
|
||||
except (RuntimeError, ValueError):
|
||||
except (RuntimeError, ValueError, AttributeError):
|
||||
flash('The type %s could not be cleaned' % mime)
|
||||
|
||||
max_file_size = int(current_app.config['MAX_CONTENT_LENGTH'] / 1024 / 1024)
|
||||
|
|
|
@ -69,7 +69,7 @@ class APIUpload(Resource):
|
|||
_external=True
|
||||
)
|
||||
), 201
|
||||
except ValueError:
|
||||
except (ValueError, AttributeError):
|
||||
current_app.logger.error('Upload - Invalid mime type')
|
||||
abort(415, message='The filetype is not supported')
|
||||
except RuntimeError:
|
||||
|
@ -119,7 +119,7 @@ class APIClean(Resource):
|
|||
raise ValueError()
|
||||
parser.remove_all()
|
||||
_, _, _, output_filename = utils.cleanup(parser, filepath, current_app.config['UPLOAD_FOLDER'])
|
||||
except ValueError:
|
||||
except (ValueError, AttributeError):
|
||||
current_app.logger.error('Upload - Invalid mime type')
|
||||
abort(415, message='The filetype is not supported')
|
||||
except RuntimeError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue