FIX bug
This commit is contained in:
parent
d391972b8b
commit
f47456f540
|
@ -29,4 +29,8 @@ module ProjectsHelper
|
||||||
|
|
||||||
member&.roles&.last&.name || permission
|
member&.roles&.last&.name || permission
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_user_by_login_or_mail(identifier)
|
||||||
|
(User.find_by_login identifier) || (User.find_by_mail identifier)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,7 @@ json.array! @branches do |branch|
|
||||||
json.time_from_now time_from_now(branch['commit']['timestamp'])
|
json.time_from_now time_from_now(branch['commit']['timestamp'])
|
||||||
end
|
end
|
||||||
|
|
||||||
user = User.find_by_login branch['commit']['author']['username']
|
user = find_user_by_login_or_mail(branch['commit']['author']['username'])
|
||||||
json.author do
|
json.author do
|
||||||
if user
|
if user
|
||||||
json.login user.login
|
json.login user.login
|
||||||
|
|
Loading…
Reference in New Issue