mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
no error when file/object already deleted
This commit is contained in:
parent
05c682b0e5
commit
a148f87701
1 changed files with 5 additions and 1 deletions
|
@ -98,7 +98,11 @@ end
|
|||
post '/site_files/delete' do
|
||||
require_login
|
||||
path = HTMLEntities.new.decode params[:filename]
|
||||
current_site.delete_file path
|
||||
begin
|
||||
current_site.delete_file path
|
||||
rescue Sequel::NoExistingObject
|
||||
# the deed was presumably already done
|
||||
end
|
||||
flash[:success] = "Deleted #{Rack::Utils.escape_html params[:filename]}."
|
||||
|
||||
dirname = Pathname(path).dirname
|
||||
|
|
Loading…
Add table
Reference in a new issue