mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Merge pull request #244 from ZmagoD/zd_SCI_608
sets current organization id as a current user first organization if is the case that the current_organization is not present [fixes SCI-608]
This commit is contained in:
commit
2cae847411
2 changed files with 5 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -87,7 +87,9 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if current_user.organizations.length > 1 %>
|
||||
<li role="separator" class="divider"></li>
|
||||
<% end %>
|
||||
<li>
|
||||
<%= link_to new_organization_path do %>
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
|
|
Loading…
Reference in a new issue