提交 a64b5e3c 编写于 作者: R Robert Speicher

Convert UserReferenceFilter#link_to_group to use a guard clause

上级 92783eae
......@@ -80,15 +80,13 @@ module Gitlab
end
def link_to_group(group, namespace)
if user_can_reference_group?(namespace)
push_result(:user, *namespace.users)
return unless user_can_reference_group?(namespace)
url = urls.group_url(group, only_path: context[:only_path])
push_result(:user, *namespace.users)
%(<a href="#{url}" class="#{link_class}">@#{group}</a>)
else
nil
end
url = urls.group_url(group, only_path: context[:only_path])
%(<a href="#{url}" class="#{link_class}">@#{group}</a>)
end
def link_to_user(user, namespace)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册