diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-08-15 16:57:02 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-08-15 16:57:02 +0200 |
commit | 566165328097c397e3217d31bff122001700ea85 (patch) | |
tree | d37973d1a15d4c1be93fe8f26a8f63c5f2fef18a | |
parent | 15bb931fd3971487fe0a391930e4a4234b480a78 (diff) | |
download | sonarqube-566165328097c397e3217d31bff122001700ea85.tar.gz sonarqube-566165328097c397e3217d31bff122001700ea85.zip |
SONAR-2412 Minor refactoring
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb index 34b0253a90b..df88dda1cd3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb @@ -57,14 +57,14 @@ class Api::ProjectsController < Api::ApiController # def destroy begin - if params[:id] - @project = Project.by_key(params[:id]) - Project.delete_project(@project) + if params[:id].present? + project = Project.by_key(params[:id]) + Project.delete_project(project) end render_success("Project deleted") rescue Exception => e logger.error("Fails to execute #{request.url} : #{e.message}") - render_error(e.message) + render_error(e.message, 500) end end |