Description of problem: According to the documentation [1], "There is one and only one shopping cart for the authenticated user" and "A shopping cart is an /api/service_orders resource with a state of cart". However it's possible to add multiple shopping carts, i.e. /api/service_orders resources with a state of "cart". The /api/service_orders/cart always points to the one with the lowest id. http://manageiq.org/docs/reference/latest/api/reference/service_orders Version-Release number of selected component (if applicable): 5.8.2 How reproducible: very Steps to Reproduce: POST /api/service_orders { "action": "create", "name": "cart" } and repeat any number of times Actual results: new /api/service_orders resources with a state of "cart" Expected results: only one shopping cart for the authenticated user can be created
PR: https://github.com/ManageIQ/manageiq-api/pull/123
updated PR https://github.com/ManageIQ/manageiq/pull/16351
On 5.9.0.10 it's still possible to create multiple carts: POST /api/service_orders { "name": "cart1"} Response: { "results": [ { ... "name": "cart1", "tenant_id": "2", "user_id": "1", "user_name": "Administrator", "state": "cart", ... } ] } POST /api/service_orders { "name": "cart2"} Response: { "results": [ { ... "name": "cart2", "tenant_id": "2", "user_id": "1", "user_name": "Administrator", "state": "cart", ... } ] }
https://github.com/ManageIQ/manageiq-api/pull/324
New commit detected on ManageIQ/manageiq-api/master: https://github.com/ManageIQ/manageiq-api/commit/fa36a7f18a4fa838b2dc64b2a9fa4297337a3c78 commit fa36a7f18a4fa838b2dc64b2a9fa4297337a3c78 Author: Jillian Tullo <jtullo> AuthorDate: Fri Feb 16 15:12:35 2018 -0500 Commit: Jillian Tullo <jtullo> CommitDate: Fri Feb 16 15:36:42 2018 -0500 Only allow one cart to be created at a time This ensures that the user is assigned before saving, to ensure that only one cart is created at a time Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1493788 app/controllers/api/service_orders_controller.rb | 13 +++++++++++-- spec/requests/service_orders_spec.rb | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-)
FIXED. Verified on 5.10.0.30.20181218191323_900a416.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:0212