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

Convert UserReferenceFilter#link_to_group to use a guard clause

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