mirror of
https://github.com/neocities/neocities.git
synced 2025-07-04 10:03:28 +02:00
catch already created records errors
This commit is contained in:
parent
262fc34bb9
commit
bca7ecb95f
2 changed files with 11 additions and 5 deletions
|
@ -52,7 +52,10 @@ post '/site_files/create' do
|
|||
end
|
||||
|
||||
if extname.match(/^\.html|^\.htm/i)
|
||||
current_site.install_new_html_file name
|
||||
begin
|
||||
current_site.install_new_html_file name
|
||||
rescue Sequel::UniqueConstraintViolation
|
||||
end
|
||||
else
|
||||
file_path = current_site.files_path(name)
|
||||
FileUtils.touch file_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue