From: Fabrice Bellingard Date: Wed, 4 Sep 2013 11:10:21 +0000 (+0200) Subject: Improve error message when creating duplicate dashboard. X-Git-Tag: 3.7.1~5^2~15^2~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fcf8ea15419d2b9ce1321805d14dda15cbe08ee7;p=sonarqube.git Improve error message when creating duplicate dashboard. --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb index 89e3b42a34f..bd86055c0d5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb @@ -59,7 +59,7 @@ class DashboardsController < ApplicationController active_dashboard = current_user.active_dashboards.to_a.find { |ad| ad.name==@dashboard.name } if active_dashboard - @dashboard.errors.add(Api::Utils.message('dashboard.error_create_existing_name')) + @dashboard.errors.add_to_base(Api::Utils.message('dashboard.error_create_existing_name')) render :partial => 'dashboards/create_form', :status => 400, :resource => params[:resource] elsif @dashboard.save add_default_dashboards_if_first_user_dashboard(@dashboard.global?)