aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-07 14:17:48 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-07 14:17:56 +0200
commitfec4feea06fcee34ed4329b2610a9f7ea6b7f2af (patch)
treef195e3802bc6c05c7f104259c140eb082f90d02c /server/sonar-web
parent026adeae78d28f4a8da9cdb0fe066047b2fcaa98 (diff)
downloadsonarqube-fec4feea06fcee34ed4329b2610a9f7ea6b7f2af.tar.gz
sonarqube-fec4feea06fcee34ed4329b2610a9f7ea6b7f2af.zip
SONAR-5630 The permalink to a deleted profile should display a nice message
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
index 008f76db170..b6a5ba9f4e2 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
@@ -40,11 +40,16 @@ class ProfilesController < ApplicationController
require_parameters 'key'
call_backend do
@profile = Internal.qprofile_loader.getByKey(params[:key])
- not_found('Profile not found') unless @profile
- @deprecated_active_rules = Internal.qprofile_loader.countDeprecatedActiveRulesByProfile(@profile.getKey())
- @stats = Internal.qprofile_loader.getStatsByProfile(@profile.getKey())
+ if @profile
+ @deprecated_active_rules = Internal.qprofile_loader.countDeprecatedActiveRulesByProfile(@profile.getKey())
+ @stats = Internal.qprofile_loader.getStatsByProfile(@profile.getKey())
+ set_profile_breadcrumbs
+ else
+ # SONAR-5630
+ flash[:error] = message('quality_profiles.deleted_profile', :params => params[:key])
+ redirect_to :controller => 'profiles', :action => 'index'
+ end
end
- set_profile_breadcrumbs
end
# GET /profiles/create_form?language=<language>