mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-03 10:24:30 +08:00
fixed new user registration
This commit is contained in:
parent
8cd86a50bb
commit
8f24d0d80c
2 changed files with 7 additions and 0 deletions
|
@ -158,6 +158,10 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
||||||
organization: @org,
|
organization: @org,
|
||||||
role: :admin
|
role: :admin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# set current organization to new user
|
||||||
|
resource.current_organization_id = @org.id
|
||||||
|
resource.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -101,10 +101,12 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Global team switch -->
|
<!-- Global team switch -->
|
||||||
|
<% if current_user.organizations.length > 1 %>
|
||||||
<li class="dropdown" id="team-switch">
|
<li class="dropdown" id="team-switch">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
|
||||||
<span><%= current_organization.name %></span>
|
<span><%= current_organization.name %></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<ul class="dropdown-menu ">
|
<ul class="dropdown-menu ">
|
||||||
<%= form_for(current_user,
|
<%= form_for(current_user,
|
||||||
url: user_current_organization_path,
|
url: user_current_organization_path,
|
||||||
|
@ -117,6 +119,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<!-- greetings -->
|
<!-- greetings -->
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
|
|
Loading…
Add table
Reference in a new issue