Bug #7730
closedActivationKey: UI raises misleading validation error on updating the content-host limit from finite number to 'unlimited'
Description
by Sachin Ghai
updating the limit to 'unlimited' throws misleading error
Description of problem:
I created a activation-key with "content host limit" 6.
Later, I updated the limit to unlimited and UI raises error:
An error occurred saving the Activation Key: Validation failed: Max content hosts cannot be nil
Firstly, I updated the limit to 'unlimited' and error message says "Max content hosts cannot be nil" This error message is misleading here, isn't it ?
Please correct me if I misunderstood something..
Version-Release number of selected component (if applicable):
sat6 GA snap3
How reproducible:
always
Steps to Reproduce:
1. create a activation-eky with content-host limit with finite no ( say 6)
2. Update the limit to 'unlimited'
3.
Actual results:
UI throws error:
An error occurred saving the Activation Key: Validation failed: Max content hosts cannot be nil
Expected results:
The limit should be updated to 'unlimited' without any error
Additional info:
logs from production.log on updating limit:
---
Processing by Katello::Api::V2::ActivationKeysController#update as JSON
Parameters: {"organization"=>{"name"=>"Default_Organization", "label"=>"Default_Organization"}, "created_at"=>"2014-08-06T06:42:49Z", "updated_at"=>"2014-08-06T06:42:59Z", "id"=>"4", "name"=>"testkey", "description"=>nil, "unlimited_content_hosts"=>true, "content_view"=>{"id"=>1, "name"=>"Default Organization View", "label"=>"Default_Organization_View", "description"=>nil, "organization_id"=>1, "default"=>true, "created_at"=>"2014-07-31T11:59:07Z", "updated_at"=>"2014-07-31T11:59:07Z", "composite"=>nil, "next_version"=>1, "organization"=>"Default_Organization", "environments"=>["Library"], "versions"=>[1], "versions_details"=>[{"version"=>1, "published"=>"2014-07-31 11:59:07 UTC", "environments"=>["Library"]}]}, "content_view_id"=>1, "environment_id"=>1, "usage_count"=>0, "user_id"=>3, "max_content_hosts"=>6, "release_version"=>nil, "service_level"=>nil, "pools"=>[], "content_overrides"=>[], "permissions"=>{"view_activation_keys"=>true, "edit_activation_keys"=>true, "destroy_activation_keys"=>true}, "environment"=>{"id"=>1, "name"=>"Library", "selected"=>true}, "products"=>[], "host_collections"=>[], "api_version"=>"v2", "activation_key"=>{"id"=>"4", "name"=>"testkey", "description"=>nil, "environment_id"=>1, "created_at"=>"2014-08-06T06:42:49Z", "updated_at"=>"2014-08-06T06:42:59Z", "user_id"=>3, "max_content_hosts"=>6, "content_view_id"=>1, "release_version"=>nil, "unlimited_content_hosts"=>true, "service_level"=>nil}}
ActiveRecord::RecordInvalid
max_content_hosts: ["cannot be nil"]
Completed 422 Unprocessable Entity in 245ms (Views: 0.8ms | ActiveRecord: 4.6ms)
Client disconnected.