|
|
@ -243,7 +243,7 @@ class User < Principal
|
|
|
|
after_create :act_as_activity, :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index
|
|
|
|
after_create :act_as_activity, :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
# 更新邮箱用户或用户名的同事,同步更新邀请信息
|
|
|
|
# 更新邮箱用户或用户名的同事,同步更新邀请信息
|
|
|
|
after_update :update_invite_list,:upadte_user_ealasticsearch_index
|
|
|
|
after_update :update_invite_list,:update_user_ealasticsearch_index
|
|
|
|
|
|
|
|
|
|
|
|
include Trustie::Gitlab::ManageUser
|
|
|
|
include Trustie::Gitlab::ManageUser
|
|
|
|
|
|
|
|
|
|
|
@ -1161,6 +1161,23 @@ class User < Principal
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_user_ealasticsearch_index
|
|
|
|
|
|
|
|
if self.id != 2 && self.id != 4
|
|
|
|
|
|
|
|
self.__elasticsearch__.index_document
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_user_ealasticsearch_index
|
|
|
|
|
|
|
|
if self.id != 2 && self.id != 4
|
|
|
|
|
|
|
|
self.__elasticsearch__.update_document
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def delete_user_ealasticsearch_index
|
|
|
|
|
|
|
|
if self.id != 2 && self.id != 4
|
|
|
|
|
|
|
|
self.__elasticsearch__.delete_document
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
class AnonymousUser < User
|
|
|
|
class AnonymousUser < User
|
|
|
@ -1196,21 +1213,6 @@ class AnonymousUser < User
|
|
|
|
false
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def create_user_ealasticsearch_index
|
|
|
|
|
|
|
|
if self.id != 2 && self.id != 4
|
|
|
|
|
|
|
|
self.__elasticsearch__.index_document
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def update_user_ealasticsearch_index
|
|
|
|
|
|
|
|
if self.id != 2 && self.id != 4
|
|
|
|
|
|
|
|
self.__elasticsearch__.update_document
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def delete_user_ealasticsearch_index
|
|
|
|
|
|
|
|
if self.id != 2 && self.id != 4
|
|
|
|
|
|
|
|
self.__elasticsearch__.delete_document
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Delete the previous articles index in Elasticsearch
|
|
|
|
# Delete the previous articles index in Elasticsearch
|
|
|
|