Commit fd8fc13d authored by Paul Brown's avatar Paul Brown

throw an exception when file already exists

parent a31f5c34
......@@ -597,8 +597,8 @@ class FileAdmin(BaseView, ActionsMixin):
if op.exists(filename):
secure_name = op.join(path, secure_filename(form.upload.data.filename))
flash(gettext('File "%(name)s" already exists.', name=secure_name),
'error')
raise Exception(gettext('File "%(name)s" already exists.',
name=secure_name))
else:
self.save_file(filename, form.upload.data)
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