diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-16 22:59:39 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-10-16 22:59:39 -0700 |
commit | dad831662ad6521dfaf404621b72e551d456ca5c (patch) | |
tree | a4f3e36675bfef1a2189b61e8b71bc293e7dd56b /lib/api | |
parent | 9afc930b999048594e3f5a6a22097adcf2da50fe (diff) | |
parent | 12420a2256168a122b3a1f5a2c974df52fe802ec (diff) | |
download | gitlab-ce-dad831662ad6521dfaf404621b72e551d456ca5c.tar.gz |
Merge pull request #5350 from NARKOZ/patch-0
fix variable name
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/helpers.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 2b0c672c7fa..1db1f396389 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -11,12 +11,8 @@ module API # If the sudo is the current user do nothing 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? - begin - @current_user = User.by_username_or_id(identifier) - rescue => ex - not_found!("No user id or username for: #{identifier}") - end - not_found!("No user id or username for: #{identifier}") if current_user.nil? + @current_user = User.by_username_or_id(identifier) + not_found!("No user id or username for: #{identifier}") if @current_user.nil? end @current_user end |