Skip to content

Commit 50148c9

Browse files
committed
Fix error message when deleting and providing a non-GF replacement URL
1 parent a94af40 commit 50148c9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/controllers/scripts_controller.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,10 @@ def do_delete
481481
# Handle replaced by
482482
replaced_by = get_script_from_input(params[:replaced_by_script_id])
483483
case replaced_by
484-
when :non_gf_url
484+
when :non_gf_url, :non_script_url
485485
@script.errors.add(:replaced_by_script_id, I18n.t('errors.messages.must_be_greasy_fork_script', site_name:))
486486
render :delete
487487
return
488-
when :non_script_url
489-
@script.errors.add(:replaced_by_script_id, :must_be_greasy_fork_script)
490-
render :delete
491-
return
492488
when :not_found
493489
@script.errors.add(:replaced_by_script_id, :not_found)
494490
render :delete

0 commit comments

Comments
 (0)