[PATCH conductor] Condition added to XML validation in Deployable

Jozef Zigmund jzigmund at redhat.com
Mon Dec 5 15:44:05 UTC 2011


On Monday 28 November 2011 14:36:22 ifarkas at redhat.com wrote:
> From: Imre Farkas <ifarkas at redhat.com>
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=756690
> ---
>  src/app/controllers/catalog_entries_controller.rb |    3 +--
>  src/app/models/deployable.rb                      |    2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/app/controllers/catalog_entries_controller.rb
> b/src/app/controllers/catalog_entries_controller.rb index 465e741..0c4a31d
> 100644
> --- a/src/app/controllers/catalog_entries_controller.rb
> +++ b/src/app/controllers/catalog_entries_controller.rb
> @@ -105,8 +105,7 @@ class CatalogEntriesController < ApplicationController
>          @catalog_entry.deployable.name = @image.name
>        else
>          params.delete(:edit_xml) if params[:edit_xml]
> -        @form_option = params[:catalog_entry].has_key?(:xml) ? 'upload' :
> 'from_url' -        @form_option =
> params[:catalog_entry][:deployable].has_key?(:xml) ? 'upload' : 'from_url'
> +        @form_option = params.has_key?(:url) ? 'from_url' : 'upload' end
>        render :new
>      end
> diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
> index 8f869a4..f67b9aa 100644
> --- a/src/app/models/deployable.rb
> +++ b/src/app/models/deployable.rb
> @@ -24,7 +24,7 @@ class Deployable < ActiveRecord::Base
>    validates_length_of :name, :maximum => 1024
> 
>    validates_presence_of :xml
> -  validate :valid_deployable_xml?
> +  validate :valid_deployable_xml?, :if => Proc.new { |deployable|
> !deployable.xml.blank? }
> 
>    has_many :permissions, :as => :permission_object, :dependent => :destroy,
>             :include => [:role],

Could you rebase and resend the patch, now it cannot be applied on master.



More information about the aeolus-devel mailing list