From 900a863bf0c37f55478e0e330bd4e0fc050e8f22 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 19 Nov 2019 18:48:54 +0800
Subject: [PATCH] 1
---
app/models/user.rb | 4 ++++
.../admins/identity_authentications/shared/_list.html.erb | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
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 %>