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:
authorStan Hu <stanhu@gmail.com>2018-10-14 16:07:12 +0300
committerStan Hu <stanhu@gmail.com>2018-10-15 20:18:04 +0300
commitc6ac04e4da60707a7bf13c796f95844e5409f451 (patch)
tree241b92c458a0bb1b34b4aa33ac4e9c80967cd849 /app
parent75b6ed8d2d0591efa19b02173c0524551e95f691 (diff)
Fix commit signature error when project is disabled
When a project is disabled, visiting the home page would show, "An error occurred while loading commit signatures". This change checks that the user has permission to view the project to avoid unnecessary GPG signature lookups. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50903
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/show.html.haml4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index aba289c790f..283031b06da 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -8,8 +8,8 @@
= render partial: 'flash_messages', locals: { project: @project }
-- if @project.repository_exists? && !@project.empty_repo?
- - signatures_path = namespace_project_signatures_path(namespace_id: @project.namespace.full_path, project_id: @project.path, id: @project.default_branch)
+- if !@project.empty_repo? && can?(current_user, :download_code, @project)
+ - signatures_path = project_signatures_path(@project, @project.default_branch)
.js-signature-container{ data: { 'signatures-path': signatures_path } }
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }