Commit 69c7d48e authored by Douwe Maan's avatar Douwe Maan

Merge branch 'sh-fix-commit-signatures-error' into 'master'

Fix commit signature error when project is disabled

Closes #50903

See merge request gitlab-org/gitlab-ce!22344
parents 4f475b81 c6ac04e4
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
= render partial: 'flash_messages', locals: { project: @project } = render partial: 'flash_messages', locals: { project: @project }
- if @project.repository_exists? && !@project.empty_repo? - if !@project.empty_repo? && can?(current_user, :download_code, @project)
- signatures_path = namespace_project_signatures_path(namespace_id: @project.namespace.full_path, project_id: @project.path, id: @project.default_branch) - signatures_path = project_signatures_path(@project, @project.default_branch)
.js-signature-container{ data: { 'signatures-path': signatures_path } } .js-signature-container{ data: { 'signatures-path': signatures_path } }
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] } %div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }
......
---
title: Fix commit signature error when project is disabled
merge_request: 22344
author:
type: fixed
...@@ -193,6 +193,23 @@ describe 'Project' do ...@@ -193,6 +193,23 @@ describe 'Project' do
end end
end end
describe 'when the project repository is disabled', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository_disabled, :repository, namespace: user.namespace) }
before do
sign_in(user)
project.add_maintainer(user)
visit project_path(project)
end
it 'does not show an error' do
wait_for_requests
expect(page).not_to have_selector('.flash-alert')
end
end
describe 'removal', :js do describe 'removal', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, namespace: user.namespace) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment