summaryrefslogtreecommitdiff
path: root/lib/constraints
diff options
context:
space:
mode:
Diffstat (limited to 'lib/constraints')
-rw-r--r--lib/constraints/group_url_constrainer.rb2
-rw-r--r--lib/constraints/user_url_constrainer.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/constraints/group_url_constrainer.rb b/lib/constraints/group_url_constrainer.rb
index 2bf973a73da..2af6e1a11c8 100644
--- a/lib/constraints/group_url_constrainer.rb
+++ b/lib/constraints/group_url_constrainer.rb
@@ -7,7 +7,7 @@ class GroupUrlConstrainer
id = extract_resource_path(request.path)
if id =~ Gitlab::Regex.namespace_regex
- !!Group.find_by_path(id)
+ Group.find_by(path: id).present?
else
false
end
diff --git a/lib/constraints/user_url_constrainer.rb b/lib/constraints/user_url_constrainer.rb
index 9583cace022..4d722ad5af2 100644
--- a/lib/constraints/user_url_constrainer.rb
+++ b/lib/constraints/user_url_constrainer.rb
@@ -7,7 +7,7 @@ class UserUrlConstrainer
id = extract_resource_path(request.path)
if id =~ Gitlab::Regex.namespace_regex
- !!User.find_by('lower(username) = ?', id.downcase)
+ User.find_by('lower(username) = ?', id.downcase).present?
else
false
end