Commit a64b5e3c authored by Robert Speicher's avatar Robert Speicher

Convert UserReferenceFilter#link_to_group to use a guard clause

parent 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)
url = urls.group_url(group, only_path: context[:only_path]) push_result(:user, *namespace.users)
%(<a href="#{url}" class="#{link_class}">@#{group}</a>) url = urls.group_url(group, only_path: context[:only_path])
else
nil %(<a href="#{url}" class="#{link_class}">@#{group}</a>)
end
end end
def link_to_user(user, namespace) def link_to_user(user, namespace)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment