Commit 38f2400b authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #1096 from pawl/already_exists_exception

FileAdmin - alert user when upload fails due to file already existing
parents a31f5c34 fd8fc13d
...@@ -597,8 +597,8 @@ class FileAdmin(BaseView, ActionsMixin): ...@@ -597,8 +597,8 @@ class FileAdmin(BaseView, ActionsMixin):
if op.exists(filename): if op.exists(filename):
secure_name = op.join(path, secure_filename(form.upload.data.filename)) secure_name = op.join(path, secure_filename(form.upload.data.filename))
flash(gettext('File "%(name)s" already exists.', name=secure_name), raise Exception(gettext('File "%(name)s" already exists.',
'error') name=secure_name))
else: else:
self.save_file(filename, form.upload.data) self.save_file(filename, form.upload.data)
self.on_file_upload(directory, path, filename) self.on_file_upload(directory, path, filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment