From 681a4851922a918a2c40310794088f12fccd7000 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Thu, 18 May 2023 09:50:56 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E5=AE=A1=E6=89=B9utf8mb4?= 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)