Project

General

Profile

Actions

Bug #6336

closed

500 ISE on creating an activation key with same name as the one already exists in other org

Added by Thomas McKay over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Web UI
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1105024
Description of problem:
I created an org "org1" and created a activation key with name "ak1" under org1.
Later, i created another org "org2" and tried to create an activation key with same name "ak1" (as the one already in org1) but this time I couldn't able to save the create activation key form. And production.log thrown an 500 Internal Server error:

Processing by Katello::Api::V2::ActivationKeysController#create as JSON
Parameters: {"usage_limit"=>-1, "name"=>"ak1", "environment"=>{"id"=>2, "name"=>"Library", "select"=>true, "selected"=>true}, "content_view_id"=>2, "organization_id"=>"3", "api_version"=>"v2", "activation_key"=>{"name"=>"ak1", "organization_id"=>"3", "usage_limit"=>-1, "content_view_id"=>2}}
PGError: ERROR: duplicate key value violates unique constraint "index_activation_keys_on_label"

Version-Release number of selected component (if applicable):
sat6 beta snap8 (Satellite-6.0.3-RHEL-6-20140604.0)

How reproducible:
always

Steps to Reproduce:
1. Create org1
2. create activation key with name ak1 under org1
3. create org2
4. create another activation key with same name "ak1" under "org2"

Actual results:
Processing by Katello::Api::V2::ActivationKeysController#create as JSON
Parameters: {"usage_limit"=>-1, "name"=>"ak1", "environment"=>{"id"=>2, "name"=>"Library", "select"=>true, "selected"=>true}, "content_view_id"=>2, "organization_id"=>"3", "api_version"=>"v2", "activation_key"=>{"name"=>"ak1", "organization_id"=>"3", "usage_limit"=>-1, "content_view_id"=>2}}
PGError: ERROR: duplicate key value violates unique constraint "index_activation_keys_on_label"

Expected results:
I think user should be able to create activation key with same name in two different orgs and there shouldn't be any error in production.log

Additional info:

Actions

Also available in: Atom PDF