[PATCH conductor] BZ 831687 Flash warning message fixed when it's empty

jzigmund at redhat.com jzigmund at redhat.com
Wed Jul 18 12:31:27 UTC 2012


From: Jozef Zigmund <jzigmund at redhat.com>

---
 src/app/controllers/deployables_controller.rb |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
index 3e3b76a..e07a603 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -167,7 +167,8 @@ class DeployablesController < ApplicationController
       end
 
       # check that type attrs on service params are used properly
-      if warnings = @deployable.check_service_params_types
+      warnings = @deployable.check_service_params_types
+      unless warnings.empty?
         flash[:warning] ||= []
         flash[:warning] = [flash[:warning]] if flash[:warning].kind_of? String
         flash[:warning]+=warnings
@@ -207,7 +208,8 @@ class DeployablesController < ApplicationController
 
     if @deployable.update_attributes(params[:deployable])
       # check that type attrs on service params are used properly
-      if warnings = @deployable.check_service_params_types
+      warnings = @deployable.check_service_params_types
+      unless warnings.empty?
         flash[:warning] ||= []
         flash[:warning] = [flash[:warning]] if flash[:warning].kind_of? String
         flash[:warning]+=warnings
-- 
1.7.10.4




More information about the aeolus-devel mailing list