Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-20 12:24:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-20 12:24:38 +0300
commit898e2cc1dfa88b4ac39cb4b35011f61b37f57b51 (patch)
treec6524edb6c9a43cccf93be05c36883fde1a53ee4 /app/controllers
parentb5571e6e22cdacc81f78eff5943d68c8ba220fbb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/system_info_controller.rb8
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb2
-rw-r--r--app/controllers/projects/pages_controller.rb10
-rw-r--r--app/controllers/projects/starrers_controller.rb4
4 files changed, 15 insertions, 9 deletions
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb
index 244fc2b31bb..657aa177ecf 100644
--- a/app/controllers/admin/system_info_controller.rb
+++ b/app/controllers/admin/system_info_controller.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
class Admin::SystemInfoController < Admin::ApplicationController
- EXCLUDED_MOUNT_OPTIONS = [
- 'nobrowse',
- 'read-only',
- 'ro'
+ EXCLUDED_MOUNT_OPTIONS = %w[
+ nobrowse
+ read-only
+ ro
].freeze
EXCLUDED_MOUNT_TYPES = [
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index 92f36c031f1..1f1c01c8fcc 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -31,7 +31,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
# Extend the standard message generation to accept our custom exception
def failure_message
exception = request.env["omniauth.error"]
- error = exception.error_reason if exception.respond_to?(:error_reason)
+ error = exception.error_reason if exception.respond_to?(:error_reason)
error ||= exception.error if exception.respond_to?(:error)
error ||= exception.message if exception.respond_to?(:message)
error ||= request.env["omniauth.error.type"].to_s
diff --git a/app/controllers/projects/pages_controller.rb b/app/controllers/projects/pages_controller.rb
index f1e591ea1ec..18a171700e9 100644
--- a/app/controllers/projects/pages_controller.rb
+++ b/app/controllers/projects/pages_controller.rb
@@ -34,7 +34,7 @@ class Projects::PagesController < Projects::ApplicationController
if result[:status] == :success
flash[:notice] = 'Your changes have been saved'
else
- flash[:alert] = 'Something went wrong on our end'
+ flash[:alert] = result[:message]
end
redirect_to project_pages_path(@project)
@@ -45,6 +45,12 @@ class Projects::PagesController < Projects::ApplicationController
private
def project_params
- params.require(:project).permit(:pages_https_only)
+ params.require(:project).permit(project_params_attributes)
+ end
+
+ def project_params_attributes
+ %i[pages_https_only]
end
end
+
+Projects::PagesController.prepend_if_ee('EE::Projects::PagesController')
diff --git a/app/controllers/projects/starrers_controller.rb b/app/controllers/projects/starrers_controller.rb
index 4efe956e973..d9654f4f72a 100644
--- a/app/controllers/projects/starrers_controller.rb
+++ b/app/controllers/projects/starrers_controller.rb
@@ -7,8 +7,8 @@ class Projects::StarrersController < Projects::ApplicationController
@starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute
@sort = params[:sort].presence || sort_value_name
@starrers = @starrers.preload_users.sort_by_attribute(@sort).page(params[:page])
- @public_count = @project.starrers.with_public_profile.size
- @total_count = @project.starrers.size
+ @public_count = @project.starrers.with_public_profile.size
+ @total_count = @project.starrers.size
@private_count = @total_count - @public_count
end