diff options
Diffstat (limited to 'app/controllers/concerns/snippets_actions.rb')
-rw-r--r-- | app/controllers/concerns/snippets_actions.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/concerns/snippets_actions.rb b/app/controllers/concerns/snippets_actions.rb index bb46345d362..f80e891a558 100644 --- a/app/controllers/concerns/snippets_actions.rb +++ b/app/controllers/concerns/snippets_actions.rb @@ -28,4 +28,11 @@ module SnippetsActions def convert_line_endings(content) params[:line_ending] == 'raw' ? content : content.gsub(/\r\n/, "\n") end + + def check_repository_error + repository_error = snippet.errors.delete(:repository) + + flash.now[:alert] = repository_error if repository_error + recaptcha_check_with_fallback(repository_error.nil?) { render :edit } + end end |