Skip to content
Snippets Groups Projects
Commit 190e204d authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 926a7790
No related branches found
No related tags found
No related merge requests found
Showing
with 26 additions and 33 deletions
Loading
Loading
@@ -401,13 +401,6 @@ Rails/FilePath:
Rails/HasManyOrHasOneDependent:
Enabled: false
 
# Offense count: 40
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: numeric, symbolic
Rails/HttpStatus:
Enabled: false
# Offense count: 2
# Configuration parameters: Include.
# Include: app/controllers/**/*.rb
Loading
Loading
Loading
Loading
@@ -44,7 +44,7 @@ class Admin::ApplicationsController < Admin::ApplicationController
 
def destroy
@application.destroy
redirect_to admin_applications_url, status: 302, notice: _('Application was successfully destroyed.')
redirect_to admin_applications_url, status: :found, notice: _('Application was successfully destroyed.')
end
 
private
Loading
Loading
Loading
Loading
@@ -69,7 +69,7 @@ class Admin::GroupsController < Admin::ApplicationController
Groups::DestroyService.new(@group, current_user).async_execute
 
redirect_to admin_groups_path,
status: 302,
status: :found,
alert: _('Group %{group_name} was scheduled for deletion.') % { group_name: @group.name }
end
 
Loading
Loading
Loading
Loading
@@ -38,9 +38,9 @@ class Admin::IdentitiesController < Admin::ApplicationController
def destroy
if @identity.destroy
RepairLdapBlockedUserService.new(@user).execute
redirect_to admin_user_identities_path(@user), status: 302, notice: _('User identity was successfully removed.')
redirect_to admin_user_identities_path(@user), status: :found, notice: _('User identity was successfully removed.')
else
redirect_to admin_user_identities_path(@user), status: 302, alert: _('Failed to remove user identity.')
redirect_to admin_user_identities_path(@user), status: :found, alert: _('Failed to remove user identity.')
end
end
 
Loading
Loading
Loading
Loading
@@ -17,9 +17,9 @@ class Admin::KeysController < Admin::ApplicationController
 
respond_to do |format|
if key.destroy
format.html { redirect_to keys_admin_user_path(user), status: 302, notice: _('User key was successfully removed.') }
format.html { redirect_to keys_admin_user_path(user), status: :found, notice: _('User key was successfully removed.') }
else
format.html { redirect_to keys_admin_user_path(user), status: 302, alert: _('Failed to remove user key.') }
format.html { redirect_to keys_admin_user_path(user), status: :found, alert: _('Failed to remove user key.') }
end
end
end
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@ class Admin::LabelsController < Admin::ApplicationController
 
respond_to do |format|
format.html do
redirect_to admin_labels_path, status: 302, notice: _('Label was removed')
redirect_to admin_labels_path, status: :found, notice: _('Label was removed')
end
format.js
end
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ class Admin::ProjectsController < Admin::ApplicationController
 
redirect_to admin_projects_path, status: :found
rescue Projects::DestroyService::DestroyError => ex
redirect_to admin_projects_path, status: 302, alert: ex.message
redirect_to admin_projects_path, status: :found, alert: ex.message
end
 
# rubocop: disable CodeReuse/ActiveRecord
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ class Admin::SpamLogsController < Admin::ApplicationController
if params[:remove_user]
spam_log.remove_user(deleted_by: current_user)
redirect_to admin_spam_logs_path,
status: 302,
status: :found,
notice: _('User %{username} was successfully removed.') % { username: spam_log.user.username }
else
spam_log.destroy
Loading
Loading
Loading
Loading
@@ -169,7 +169,7 @@ class Admin::UsersController < Admin::ApplicationController
user.delete_async(deleted_by: current_user, params: params.permit(:hard_delete))
 
respond_to do |format|
format.html { redirect_to admin_users_path, status: 302, notice: _("The user is being deleted.") }
format.html { redirect_to admin_users_path, status: :found, notice: _("The user is being deleted.") }
format.json { head :ok }
end
end
Loading
Loading
Loading
Loading
@@ -58,7 +58,7 @@ class ApplicationController < ActionController::Base
 
rescue_from Encoding::CompatibilityError do |exception|
log_exception(exception)
render "errors/encoding", layout: "errors", status: 500
render "errors/encoding", layout: "errors", status: :internal_server_error
end
 
rescue_from ActiveRecord::RecordNotFound do |exception|
Loading
Loading
@@ -197,19 +197,19 @@ class ApplicationController < ActionController::Base
end
 
def git_not_found!
render "errors/git_not_found.html", layout: "errors", status: 404
render "errors/git_not_found.html", layout: "errors", status: :not_found
end
 
def render_403
respond_to do |format|
format.any { head :forbidden }
format.html { render "errors/access_denied", layout: "errors", status: 403 }
format.html { render "errors/access_denied", layout: "errors", status: :forbidden }
end
end
 
def render_404
respond_to do |format|
format.html { render "errors/not_found", layout: "errors", status: 404 }
format.html { render "errors/not_found", layout: "errors", status: :not_found }
# Prevent the Rails CSRF protector from thinking a missing .js file is a JavaScript file
format.js { render json: '', status: :not_found, content_type: 'application/json' }
format.any { head :not_found }
Loading
Loading
Loading
Loading
@@ -56,7 +56,7 @@ module LfsRequest
documentation_url: help_url
},
content_type: CONTENT_TYPE,
status: 403
status: :forbidden
)
end
 
Loading
Loading
@@ -67,7 +67,7 @@ module LfsRequest
documentation_url: help_url
},
content_type: CONTENT_TYPE,
status: 404
status: :not_found
)
end
 
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
respond_to do |format|
format.html do
redirect_to dashboard_todos_path,
status: 302,
status: :found,
notice: _('To-do item successfully marked as done.')
end
format.js { head :ok }
Loading
Loading
@@ -34,7 +34,7 @@ class Dashboard::TodosController < Dashboard::ApplicationController
updated_ids = TodoService.new.mark_todos_as_done(@todos, current_user)
 
respond_to do |format|
format.html { redirect_to dashboard_todos_path, status: 302, notice: _('Everything on your to-do list is marked as done.') }
format.html { redirect_to dashboard_todos_path, status: :found, notice: _('Everything on your to-do list is marked as done.') }
format.js { head :ok }
format.json { render json: todos_counts.merge(updated_ids: updated_ids) }
end
Loading
Loading
Loading
Loading
@@ -63,7 +63,7 @@ class Groups::LabelsController < Groups::ApplicationController
 
respond_to do |format|
format.html do
redirect_to group_labels_path(@group), status: 302, notice: "#{@label.name} deleted permanently"
redirect_to group_labels_path(@group), status: :found, notice: "#{@label.name} deleted permanently"
end
format.js
end
Loading
Loading
Loading
Loading
@@ -116,7 +116,7 @@ class GroupsController < Groups::ApplicationController
def destroy
Groups::DestroyService.new(@group, current_user).async_execute
 
redirect_to root_path, status: 302, alert: "Group '#{@group.name}' was scheduled for deletion."
redirect_to root_path, status: :found, alert: "Group '#{@group.name}' was scheduled for deletion."
end
 
# rubocop: disable CodeReuse/ActiveRecord
Loading
Loading
Loading
Loading
@@ -36,7 +36,7 @@ class HelpController < ApplicationController
render 'show.html.haml'
else
# Force template to Haml
render 'errors/not_found.html.haml', layout: 'errors', status: 404
render 'errors/not_found.html.haml', layout: 'errors', status: :not_found
end
end
 
Loading
Loading
Loading
Loading
@@ -57,7 +57,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
end
 
rescue_from ActiveRecord::RecordNotFound do |exception|
render "errors/not_found", layout: "errors", status: 404
render "errors/not_found", layout: "errors", status: :not_found
end
 
def create_application_params
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
end
 
redirect_to applications_profile_url,
status: 302,
status: :found,
notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
end
end
Loading
Loading
@@ -47,7 +47,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def omniauth_error
@provider = params[:provider]
@error = params[:error]
render 'errors/omniauth_error', layout: "oauth_error", status: 422
render 'errors/omniauth_error', layout: "oauth_error", status: :unprocessable_entity
end
 
def cas3
Loading
Loading
Loading
Loading
@@ -4,6 +4,6 @@ class Profiles::U2fRegistrationsController < Profiles::ApplicationController
def destroy
u2f_registration = current_user.u2f_registrations.find(params[:id])
u2f_registration.destroy
redirect_to profile_two_factor_auth_path, status: 302, notice: _("Successfully deleted U2F device.")
redirect_to profile_two_factor_auth_path, status: :found, notice: _("Successfully deleted U2F device.")
end
end
Loading
Loading
@@ -76,7 +76,7 @@ class Projects::LabelsController < Projects::ApplicationController
@labels = find_labels
 
redirect_to project_labels_path(@project),
status: 302,
status: :found,
notice: 'Label was removed'
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment