diff --git a/app/models/user.rb b/app/models/user.rb index 74d9b11d2..ec0640700 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -699,6 +699,10 @@ class User < ApplicationRecord LimitForbidControl::UserLogin.new(self).clear end + def from_sub_site? + laboratory_id.present? && laboratory_id != 1 + end + protected def validate_password_length # 管理员的初始密码是5位 diff --git a/app/views/admins/identity_authentications/shared/_list.html.erb b/app/views/admins/identity_authentications/shared/_list.html.erb index 02c40b5a0..607feb93a 100644 --- a/app/views/admins/identity_authentications/shared/_list.html.erb +++ b/app/views/admins/identity_authentications/shared/_list.html.erb @@ -43,7 +43,7 @@ <%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> <% end %> - <% if user&.from_sub_site? %> + <% if user.from_sub_site? %> 合作 <% end %>