]> source.dussan.org Git - sonarqube.git/commitdiff
Improve error message when creating duplicate dashboard.
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Wed, 4 Sep 2013 11:10:21 +0000 (13:10 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Wed, 4 Sep 2013 11:14:39 +0000 (13:14 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb

index 89e3b42a34f45091e4cf81238f3dceed4c6de2b2..bd86055c0d54b4424a8b31eb2330c565936ad307 100644 (file)
@@ -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?)