summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-25 15:37:04 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-25 15:37:04 +0000
commitf729f6044717635ca2dfbe054fa863d068de5c98 (patch)
treeafa470aade5624c207ef79da6c88283ff1b720e7 /lib/api
parentde9d51eea36a084376715f043ce3fc218ffd9855 (diff)
parent69454e36f77db6f6e1c45c04c39acf670fe443e4 (diff)
downloadgitlab-ce-f729f6044717635ca2dfbe054fa863d068de5c98.tar.gz
Merge branch 'more-rubocop-styles' into 'master'
More rubocop styles See merge request !449
Diffstat (limited to 'lib/api')
-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