Rename find_by_email/find_by_external_uid methods

parent e50606cd
...@@ -338,19 +338,19 @@ module Github ...@@ -338,19 +338,19 @@ module Github
return unless user.present? return unless user.present?
return cached_user_ids[user.id] if cached_user_ids.key?(user.id) return cached_user_ids[user.id] if cached_user_ids.key?(user.id)
gitlab_user_id = find_by_external_uid(user.id) || find_by_email(user.email) gitlab_user_id = user_id_by_external_uid(user.id) || user_id_by_email(user.email)
cached_gitlab_users[user.id] = gitlab_user_id.present? cached_gitlab_users[user.id] = gitlab_user_id.present?
cached_user_ids[user.id] = gitlab_user_id || fallback_id cached_user_ids[user.id] = gitlab_user_id || fallback_id
end end
def find_by_email(email) def user_id_by_email(email)
return nil unless email return nil unless email
::User.find_by_any_email(email)&.id ::User.find_by_any_email(email)&.id
end end
def find_by_external_uid(id) def user_id_by_external_uid(id)
return nil unless id return nil unless id
identities = ::Identity.arel_table identities = ::Identity.arel_table
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment