Merge branch 'dev_trustie' of http://gitea.trustie.net/jasder/forgeplus into dev_trustie

This commit is contained in:
sylor_huang@126.com 2020-05-29 19:07:05 +08:00
commit b4615c645e
2 changed files with 5 additions and 1 deletions

View File

@ -29,4 +29,8 @@ module ProjectsHelper
member&.roles&.last&.name || permission
end
def find_user_by_login_or_mail(identifier)
(User.find_by_login identifier) || (User.find_by_mail identifier)
end
end

View File

@ -13,7 +13,7 @@ json.array! @branches do |branch|
json.time_from_now time_from_now(branch['commit']['timestamp'])
end
user = User.find_by_login branch['commit']['author']['username']
user = find_user_by_login_or_mail(branch['commit']['author']['username'])
json.author do
if user
json.login user.login