Allow referencing an existing user.

This commit is contained in:
Marin Jankovski 2014-03-25 09:52:27 +01:00
parent 01ec6c793c
commit 02850210b6
1 changed files with 2 additions and 2 deletions

View File

@ -166,8 +166,8 @@ module Gitlab
end
def reference_user(identifier)
if member = @project.team_members.find { |user| user.username == identifier }
link_to("@#{identifier}", user_url(identifier), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member
if user = User.find_by_username(identifier)
link_to("@#{identifier}", user_url(identifier), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if user
end
end