diff options
Diffstat (limited to 'app/controllers/admin')
4 files changed, 22 insertions, 9 deletions
diff --git a/app/controllers/admin/applications_controller.rb b/app/controllers/admin/applications_controller.rb index 449aa90b0e6..ce7d64336c8 100644 --- a/app/controllers/admin/applications_controller.rb +++ b/app/controllers/admin/applications_controller.rb @@ -18,7 +18,10 @@ class Admin::ApplicationsController < Admin::ApplicationController end def new - @application = Doorkeeper::Application.new + # Default access tokens to expire. This preserves backward compatibility + # with existing applications. This will be removed in 15.0. + # Removal issue: https://gitlab.com/gitlab-org/gitlab/-/issues/340848 + @application = Doorkeeper::Application.new(expire_access_tokens: true) end def edit @@ -55,10 +58,13 @@ class Admin::ApplicationsController < Admin::ApplicationController @application = ApplicationsFinder.new(id: params[:id]).execute end - # Only allow a trusted parameter "white list" through. + def permitted_params + super << :trusted + end + def application_params - params - .require(:doorkeeper_application) - .permit(:name, :redirect_uri, :trusted, :scopes, :confidential) + super.tap do |params| + params[:owner] = nil + end end end diff --git a/app/controllers/admin/background_migrations_controller.rb b/app/controllers/admin/background_migrations_controller.rb index 65b47308e4c..e21e6fd2dcb 100644 --- a/app/controllers/admin/background_migrations_controller.rb +++ b/app/controllers/admin/background_migrations_controller.rb @@ -29,9 +29,16 @@ class Admin::BackgroundMigrationsController < Admin::ApplicationController redirect_back fallback_location: { action: 'index' } end + def retry + migration = batched_migration_class.find(params[:id]) + migration.retry_failed_jobs! if migration.failed? + + redirect_back fallback_location: { action: 'index' } + end + private def batched_migration_class - Gitlab::Database::BackgroundMigration::BatchedMigration + @batched_migration_class ||= Gitlab::Database::BackgroundMigration::BatchedMigration end end diff --git a/app/controllers/admin/runner_projects_controller.rb b/app/controllers/admin/runner_projects_controller.rb index 3b408de5f01..fdf681de9ef 100644 --- a/app/controllers/admin/runner_projects_controller.rb +++ b/app/controllers/admin/runner_projects_controller.rb @@ -9,7 +9,7 @@ class Admin::RunnerProjectsController < Admin::ApplicationController @runner = Ci::Runner.find(params[:runner_project][:runner_id]) if @runner.assign_to(@project, current_user) - redirect_to admin_runner_path(@runner) + redirect_to admin_runner_path(@runner), notice: s_('Runners|Runner assigned to project.') else redirect_to admin_runner_path(@runner), alert: 'Failed adding runner to project' end @@ -20,7 +20,7 @@ class Admin::RunnerProjectsController < Admin::ApplicationController runner = rp.runner rp.destroy - redirect_to admin_runner_path(runner), status: :found + redirect_to admin_runner_path(runner), status: :found, notice: s_('Runners|Runner unassigned from project.') end private diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 3801906635f..9c556d16913 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -307,7 +307,7 @@ class Admin::UsersController < Admin::ApplicationController end def user - @user ||= find_routable!(User, params[:id], request.path_info) + @user ||= find_routable!(User, params[:id], request.fullpath) end def build_canonical_path(user) |