[PATCH] BZ 773247 fix for empty message header

Jan Provaznik jprovazn at redhat.com
Wed Feb 8 15:38:28 UTC 2012


On 02/08/2012 03:53 PM, Tzu-Mainn Chen wrote:
> ---
>   src/app/controllers/deployables_controller.rb |    9 +++++----
>   1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
> index 5fc1ea3..cf5c6b0 100644
> --- a/src/app/controllers/deployables_controller.rb
> +++ b/src/app/controllers/deployables_controller.rb
> @@ -41,10 +41,11 @@ class DeployablesController<  ApplicationController
>         @deployable.name = @image.name
>         @selected_catalogs = params[:catalog_id].to_a
>         load_catalogs
> -      flash[:error] = []
> -      flash[:error]<<  t("deployables.flash.error.no_catalog_exists") if @catalogs.empty?
> -      flash[:error]<<  t("deployables.flash.error.no_hwp_exists") if @hw_profiles.empty?
> -      @save_disabled = !(flash[:error].empty?)
> +      flasherr = []
> +      flasherr<<  t("deployables.flash.error.no_catalog_exists") if @catalogs.empty?
> +      flasherr<<  t("deployables.flash.error.no_hwp_exists") if @hw_profiles.empty?
> +      @save_disabled = !(flasherr.empty?)
> +      flash[:error] = flasherr if not flasherr.empty?

"not flasherr.empty?" is equivalent to "flasherr.any?", if you prefer.

>       elsif params[:catalog_id].present?
>         @catalog = Catalog.find(params[:catalog_id])
>         require_privilege(Privilege::MODIFY, @catalog)

ACK



More information about the aeolus-devel mailing list