no error when file/object already deleted

This commit is contained in:
Kyle Drake 2024-08-20 11:14:21 -05:00
parent 05c682b0e5
commit a148f87701

View file

@ -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