fixed 提交者匹配用户email

This commit is contained in:
xxq250 2023-05-18 09:17:27 +08:00
parent 67d7d11c62
commit 6b68de130c
1 changed files with 10 additions and 2 deletions

View File

@ -36,12 +36,20 @@ module RepositoriesHelper
end end
def render_cache_commit_author(author_json) def render_cache_commit_author(author_json)
user = nil
if author_json["name"].present? && author_json["email"].present? if author_json["name"].present? && author_json["email"].present?
return find_user_in_redis_cache(author_json['name'], author_json['email']) user = find_user_in_redis_cache(author_json['name'], author_json['email'])
end end
if author_json["Name"].present? && author_json["Email"].present? if author_json["Name"].present? && author_json["Email"].present?
return find_user_in_redis_cache(author_json['Name'], author_json['Email']) user = find_user_in_redis_cache(author_json['Name'], author_json['Email'])
end end
if user.blank? && author_json["email"].present?
user = User.find_by(mail: author_json["email"])
end
if user.blank? && author_json["Email"].present?
user = User.find_by(mail: author_json["Email"])
end
user
end end
def readme_render_decode64_content(str, owner, repo, ref, path) def readme_render_decode64_content(str, owner, repo, ref, path)