diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 18:09:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 18:09:39 +0300 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /app/controllers/concerns | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/snippets_actions.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/snippets_actions.rb b/app/controllers/concerns/snippets_actions.rb index f80e891a558..a18cdd58abb 100644 --- a/app/controllers/concerns/snippets_actions.rb +++ b/app/controllers/concerns/snippets_actions.rb @@ -30,9 +30,9 @@ module SnippetsActions end def check_repository_error - repository_error = snippet.errors.delete(:repository) + repository_errors = Array(snippet.errors.delete(:repository)) - flash.now[:alert] = repository_error if repository_error - recaptcha_check_with_fallback(repository_error.nil?) { render :edit } + flash.now[:alert] = repository_errors.first if repository_errors.present? + recaptcha_check_with_fallback(repository_errors.empty?) { render :edit } end end |