Actions
Bug #22043
closedUnable to create location with organization_ids: [1] - Organizations is invalid
Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
During creation of a location, if it is assigned organizations which are invalid the creation fails as the location attempts to validate the associated organization. (This also happens the other way around). This is due to has_and_belongs_to_many defaulting to validating the associated records as well.
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1514915
Description of problem:
- curl -sku admin:changeme -d '{"location": {"name": "foo6", "organization_ids": [1]}}' -H 'Content-Type: application/json' https://$(hostname)/api/v2/locations
{
"error": {"id":null,"errors":{"organizations":["is invalid"]},"full_messages":["Organizations is invalid"]}
}
- specifying other (existing) organization id(s) works as expected
Actual results:
Organizations is invalid
Expected results:
Location created and assigned to Default Organization
Actions