diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 31ddb6d74..daafa4761 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -30,7 +30,9 @@ class ProjectsController < ApplicationController end if current_user.organizations.any? - @current_organization_id = current_organization.id + @current_organization_id = current_organization.id if current_organization + + @current_organization_id ||= current_user.organizations.first.id @current_sort = params[:sort].to_s @projects_by_orgs = current_user .projects_by_orgs(@current_organization_id, diff --git a/app/views/shared/_navigation.html.erb b/app/views/shared/_navigation.html.erb index 61530f29f..34ab19eb4 100644 --- a/app/views/shared/_navigation.html.erb +++ b/app/views/shared/_navigation.html.erb @@ -87,7 +87,9 @@ <% end %> <% end %> + <% if current_user.organizations.length > 1 %>
+ <% end %>