From 566165328097c397e3217d31bff122001700ea85 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 15 Aug 2011 16:57:02 +0200 Subject: [PATCH] SONAR-2412 Minor refactoring --- .../WEB-INF/app/controllers/api/projects_controller.rb | 8 ++++---- 1 file 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 -- 2.39.5