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)