Bug #24957
closedlisting organization fails after adding default organization/location
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1627679
*Description of problem:*After adding default organization/location, Listing organization and locations fails with error
NoMethodError: undefined method `organization_ids' for #<Organization:0x00007ff57ad59770>
*Version-Release number of selected component (if applicable):*6.4
*How reproducible:*Always
Steps to Reproduce:
Step 1.
[root@satellite64 ~]# hammer organization list
---|----------------------|----------------------|-------------|----------------------
ID | TITLE | NAME | DESCRIPTION | LABEL
---|----------------------|----------------------|-------------|----------------------
1 | Default Organization | Default Organization | | Default_Organization
---|----------------------|----------------------|-------------|----------------------
Step 2.
[root@satellite64 ~]# hammer location list
---|------------------|------------------|------------
ID | TITLE | NAME | DESCRIPTION
---|------------------|------------------|------------
2 | Default Location | Default Location |
---|------------------|------------------|------------
Step 3: add default
[root@satellite64 ~]# hammer defaults add --param-name organization_id --param-value 1
Added organization_id default-option with value 1.
[root@satellite64 ~]# hammer defaults list
----------------|------
PARAMETER | VALUE
----------------|------
organization_id | 1
----------------|------
Step 4: List location
[root@satellite64 ~]# hammer location list
---|-------|------|------------
ID | TITLE | NAME | DESCRIPTION
---|-------|------|------------
Step 5: Listing location raise an error
[root@satellite64 ~]# hammer organization list
Internal Server Error: the server was unable to finish the request.
This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs.
Error in logs
NoMethodError: undefined method `organization_ids' for #<Organization:0x00007ff57ad59770>
Did you mean? organization_parameter_ids
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activemodel-5.1.6/lib/active_model/attribute_methods.rb:432:in `method_missing'
Actual results: Listing organization raises an error
Expected results: Location and Organization should be listed
Additional info:
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6075 added
Updated by Ivan Necas over 6 years ago
- Subject changed from listing organization fails after adding default organization/location to listing organization fails after adding default organization/location
- Fixed in Releases 1.20.0 added
Updated by Marek Hulán over 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 901b2d58bcd05aade5a2fdc32e6a2eb01a4e1853.