From 6b68de130ca15f236eadcfd2e6a4c0738d4313db Mon Sep 17 00:00:00 2001 From: xxq250 Date: Thu, 18 May 2023 09:17:27 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E6=8F=90=E4=BA=A4=E8=80=85=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=94=A8=E6=88=B7email?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index c9be515d2..0f3f27ac0 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -36,12 +36,20 @@ module RepositoriesHelper end def render_cache_commit_author(author_json) + user = nil 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 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 + 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 def readme_render_decode64_content(str, owner, repo, ref, path)