Browse Source

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

tags/v1
sylor_huang@126.com 6 years ago
parent
commit
b4615c645e
2 changed files with 5 additions and 1 deletions
  1. +4
    -0
      app/helpers/projects_helper.rb
  2. +1
    -1
      app/views/projects/branches.json.jbuilder

+ 4
- 0
app/helpers/projects_helper.rb 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

+ 1
- 1
app/views/projects/branches.json.jbuilder 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


Loading…
Cancel
Save