diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 00:09:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-20 00:09:29 +0000 |
commit | b060b8b7e4e895e28226b366b92081512225cd14 (patch) | |
tree | 0364ce1045b2e0a1cc3cad7b0d487e254335b66c /app/controllers | |
parent | 49a923c646a2c24b5377cfde8236c73094c60d42 (diff) | |
download | gitlab-ce-b060b8b7e4e895e28226b366b92081512225cd14.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/services_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/concerns/import_url_params.rb | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb index 50b79cde5c5..2f554519632 100644 --- a/app/controllers/admin/services_controller.rb +++ b/app/controllers/admin/services_controller.rb @@ -41,7 +41,7 @@ class Admin::ServicesController < Admin::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def service - @service ||= Service.where(id: params[:id], template: true).first + @service ||= Service.find_by(id: params[:id], template: true) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/controllers/concerns/import_url_params.rb b/app/controllers/concerns/import_url_params.rb index e51e4157f50..28a3876810a 100644 --- a/app/controllers/concerns/import_url_params.rb +++ b/app/controllers/concerns/import_url_params.rb @@ -4,7 +4,13 @@ module ImportUrlParams def import_url_params return {} unless params.dig(:project, :import_url).present? - { import_url: import_params_to_full_url(params[:project]) } + { + import_url: import_params_to_full_url(params[:project]), + # We need to set import_type because attempting to retry an import by URL + # could leave a stale value around. This would erroneously cause an importer + # (e.g. import/export) to run. + import_type: 'git' + } end def import_params_to_full_url(params) |