mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
修改commit返回的用户
This commit is contained in:
@@ -5,11 +5,19 @@ else
|
||||
json.total_count @hash_commit[:total_count]
|
||||
json.commits do
|
||||
json.array! @hash_commit[:body] do |commit|
|
||||
commit_user = commit['committer']['name']
|
||||
if commit_user
|
||||
forge_user = User.simple_select.find_by(login: commit_user)
|
||||
end
|
||||
json.sha commit['sha']
|
||||
json.message commit['commit']['message']
|
||||
json.timestamp render_unix_time(commit['commit']['author']['date'])
|
||||
json.time_from_now time_from_now(commit['commit']['author']['date'])
|
||||
json.partial! 'author', user: @project_owner
|
||||
if forge_user
|
||||
json.partial! 'author', user: forge_user
|
||||
else
|
||||
json.author nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user