summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/snippets_actions.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:39 +0000
commitdc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch)
tree70945aa6721a271fc8057efa13c3216a03fbac45 /app/controllers/concerns/snippets_actions.rb
parentcd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff)
downloadgitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/concerns/snippets_actions.rb')
-rw-r--r--app/controllers/concerns/snippets_actions.rb6
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