Commit 41a54bd2 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Always check visibility on correct project for clone panel

The project variable can hold an object which is not an instance of
Project (e.g. ProjectWiki). In this case, visibility_level is not
defined.
parent c19e8f85
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.git-clone-holder.js-git-clone-holder.input-group .git-clone-holder.js-git-clone-holder.input-group
.input-group-prepend .input-group-prepend
- if allowed_protocols_present? && project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?) - if allowed_protocols_present? && @project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?)
.input-group-text.clone-dropdown-btn.btn .input-group-text.clone-dropdown-btn.btn
%span.js-clone-dropdown-label %span.js-clone-dropdown-label
= enabled_project_button(project, enabled_protocol) = enabled_project_button(project, enabled_protocol)
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown %ul.dropdown-menu.dropdown-menu-selectable.clone-options-dropdown
%li %li
= ssh_clone_button(project) = ssh_clone_button(project)
- if project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?) - if @project.visibility_level == Gitlab::VisibilityLevel::PUBLIC || (current_user && !current_user.cas_user?)
%li %li
= http_clone_button(project) = http_clone_button(project)
......
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