summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-24 18:28:10 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-24 18:28:10 -0700
commit6ec8ff069ceaa7bb914cbbd97ac248d926ef7e4e (patch)
treece712ef1a4bfa347f0728654eb97c2d2f7146f86 /lib/api/helpers.rb
parentb9372c999707558b695fa401b4f660a3d38fce86 (diff)
downloadgitlab-ce-6ec8ff069ceaa7bb914cbbd97ac248d926ef7e4e.tar.gz
Enable more rubocop style checks
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index a6e77002a01..be133a2920b 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -20,7 +20,7 @@ module API
identifier = sudo_identifier()
# If the sudo is the current user do nothing
- if (identifier && !(@current_user.id == identifier || @current_user.username == identifier))
+ if identifier && !(@current_user.id == identifier || @current_user.username == identifier)
render_api_error!('403 Forbidden: Must be admin to use sudo', 403) unless @current_user.is_admin?
@current_user = User.by_username_or_id(identifier)
not_found!("No user id or username for: #{identifier}") if @current_user.nil?
@@ -33,7 +33,7 @@ module API
identifier ||= params[SUDO_PARAM] ||= env[SUDO_HEADER]
# Regex for integers
- if (!!(identifier =~ /^[0-9]+$/))
+ if !!(identifier =~ /^[0-9]+$/)
identifier.to_i
else
identifier