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
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-11 03:09:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-11 03:09:17 +0300
commit2f147005c51bb8f59827ae9cf7484b8d64e7b549 (patch)
treef0ebef9d40a5bf965ef011d5272902f98c910eb5 /app
parentc7b780b56dafed09d8751d9bd7508e989a6a6379 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb4
-rw-r--r--app/controllers/chaos_controller.rb1
-rw-r--r--app/controllers/concerns/issuable_actions.rb4
-rw-r--r--app/controllers/groups/application_controller.rb8
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb2
-rw-r--r--app/controllers/projects/application_controller.rb2
-rw-r--r--app/controllers/projects/blob_controller.rb2
-rw-r--r--app/controllers/projects/releases_controller.rb2
-rw-r--r--app/controllers/projects/tree_controller.rb4
-rw-r--r--app/graphql/resolvers/projects/jira_projects_resolver.rb2
-rw-r--r--app/services/access_token_validation_service.rb10
-rw-r--r--app/services/spam/spam_verdict_service.rb2
-rw-r--r--app/workers/delete_merged_branches_worker.rb1
13 files changed, 21 insertions, 23 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 789213a5fc6..2595b646964 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -306,7 +306,7 @@ class ApplicationController < ActionController::Base
return if session[:impersonator_id] || !current_user&.allow_password_authentication?
if current_user&.password_expired?
- return redirect_to new_profile_password_path
+ redirect_to new_profile_password_path
end
end
@@ -364,7 +364,7 @@ class ApplicationController < ActionController::Base
def require_email
if current_user && current_user.temp_oauth_email? && session[:impersonator_id].nil?
- return redirect_to profile_path, notice: _('Please complete your profile with email address')
+ redirect_to profile_path, notice: _('Please complete your profile with email address')
end
end
diff --git a/app/controllers/chaos_controller.rb b/app/controllers/chaos_controller.rb
index ac008165c16..e0d1f313fc7 100644
--- a/app/controllers/chaos_controller.rb
+++ b/app/controllers/chaos_controller.rb
@@ -45,7 +45,6 @@ class ChaosController < ActionController::Base
unless Devise.secure_compare(chaos_secret_configured, chaos_secret_request)
render plain: "To experience chaos, please set a valid `X-Chaos-Secret` header or `token` param",
status: :unauthorized
- return
end
end
diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb
index 068b7bdae2a..c4dbce00593 100644
--- a/app/controllers/concerns/issuable_actions.rb
+++ b/app/controllers/concerns/issuable_actions.rb
@@ -197,13 +197,13 @@ module IssuableActions
def authorize_destroy_issuable!
unless can?(current_user, :"destroy_#{issuable.to_ability_name}", issuable)
- return access_denied!
+ access_denied!
end
end
def authorize_admin_issuable!
unless can?(current_user, :"admin_#{resource_name}", parent)
- return access_denied!
+ access_denied!
end
end
diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb
index 84c8d7ada43..9c2e361e92f 100644
--- a/app/controllers/groups/application_controller.rb
+++ b/app/controllers/groups/application_controller.rb
@@ -30,25 +30,25 @@ class Groups::ApplicationController < ApplicationController
def authorize_admin_group!
unless can?(current_user, :admin_group, group)
- return render_404
+ render_404
end
end
def authorize_create_deploy_token!
unless can?(current_user, :create_deploy_token, group)
- return render_404
+ render_404
end
end
def authorize_destroy_deploy_token!
unless can?(current_user, :destroy_deploy_token, group)
- return render_404
+ render_404
end
end
def authorize_admin_group_member!
unless can?(current_user, :admin_group_member, group)
- return render_403
+ render_403
end
end
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index 4c595313cb6..706a4843117 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -200,7 +200,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def fail_login(user)
error_message = user.errors.full_messages.to_sentence
- return redirect_to omniauth_error_path(oauth['provider'], error: error_message)
+ redirect_to omniauth_error_path(oauth['provider'], error: error_message)
end
def fail_auth0_login
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index 82f98a9e411..d78a9bf0666 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -42,7 +42,7 @@ class Projects::ApplicationController < ApplicationController
def authorize_action!(action)
unless can?(current_user, action, project)
- return access_denied!
+ access_denied!
end
end
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 80c5fb470dd..49f658d9ffc 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -129,7 +129,7 @@ class Projects::BlobController < Projects::ApplicationController
end
end
- return redirect_to_tree_root_for_missing_path(@project, @ref, @path)
+ redirect_to_tree_root_for_missing_path(@project, @ref, @path)
end
end
diff --git a/app/controllers/projects/releases_controller.rb b/app/controllers/projects/releases_controller.rb
index 3d48fb9c803..d58755c2655 100644
--- a/app/controllers/projects/releases_controller.rb
+++ b/app/controllers/projects/releases_controller.rb
@@ -30,7 +30,7 @@ class Projects::ReleasesController < Projects::ApplicationController
def new
unless Feature.enabled?(:new_release_page, project)
- return redirect_to(new_project_tag_path(@project))
+ redirect_to(new_project_tag_path(@project))
end
end
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index aadc766313d..638e1a05c18 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -20,9 +20,9 @@ class Projects::TreeController < Projects::ApplicationController
if tree.entries.empty?
if @repository.blob_at(@commit.id, @path)
- return redirect_to project_blob_path(@project, File.join(@ref, @path))
+ redirect_to project_blob_path(@project, File.join(@ref, @path))
elsif @path.present?
- return redirect_to_tree_root_for_missing_path(@project, @ref, @path)
+ redirect_to_tree_root_for_missing_path(@project, @ref, @path)
end
end
end
diff --git a/app/graphql/resolvers/projects/jira_projects_resolver.rb b/app/graphql/resolvers/projects/jira_projects_resolver.rb
index 3b6e5c4fd42..2dc712128cc 100644
--- a/app/graphql/resolvers/projects/jira_projects_resolver.rb
+++ b/app/graphql/resolvers/projects/jira_projects_resolver.rb
@@ -37,7 +37,7 @@ module Resolvers
def jira_projects(name:)
args = { query: name }.compact
- return Jira::Requests::Projects::ListService.new(project.jira_service, args).execute
+ Jira::Requests::Projects::ListService.new(project.jira_service, args).execute
end
end
end
diff --git a/app/services/access_token_validation_service.rb b/app/services/access_token_validation_service.rb
index 851d862c0cf..eb2e66a9285 100644
--- a/app/services/access_token_validation_service.rb
+++ b/app/services/access_token_validation_service.rb
@@ -17,21 +17,21 @@ class AccessTokenValidationService
def validate(scopes: [])
if token.expired?
- return EXPIRED
+ EXPIRED
elsif token.revoked?
- return REVOKED
+ REVOKED
elsif !self.include_any_scope?(scopes)
- return INSUFFICIENT_SCOPE
+ INSUFFICIENT_SCOPE
elsif token.respond_to?(:impersonation) &&
token.impersonation &&
!Gitlab.config.gitlab.impersonation_enabled
- return IMPERSONATION_DISABLED
+ IMPERSONATION_DISABLED
else
- return VALID
+ VALID
end
end
diff --git a/app/services/spam/spam_verdict_service.rb b/app/services/spam/spam_verdict_service.rb
index be156a0ebeb..ba1c583c7af 100644
--- a/app/services/spam/spam_verdict_service.rb
+++ b/app/services/spam/spam_verdict_service.rb
@@ -57,7 +57,7 @@ module Spam
rescue *Gitlab::HTTP::HTTP_ERRORS => e
# @TODO: log error via try_post https://gitlab.com/gitlab-org/gitlab/-/issues/219223
Gitlab::ErrorTracking.log_exception(e)
- return
+ nil
rescue
# @TODO log
ALLOW
diff --git a/app/workers/delete_merged_branches_worker.rb b/app/workers/delete_merged_branches_worker.rb
index ab3d42e5384..8d7026e2d1e 100644
--- a/app/workers/delete_merged_branches_worker.rb
+++ b/app/workers/delete_merged_branches_worker.rb
@@ -17,7 +17,6 @@ class DeleteMergedBranchesWorker # rubocop:disable Scalability/IdempotentWorker
begin
::Branches::DeleteMergedService.new(project, user).execute
rescue Gitlab::Access::AccessDeniedError
- return
end
end
end