From 50eef54e29152d2663c9a9792ac5130eb15ad6dd Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Thu, 18 Oct 2018 13:41:00 -0400 Subject: [PATCH] Merge pull request #497 from d-m-u/fixing_make_retire_request_call_with_user_thingyamabobbers_n_stuff_for_great_justice Need the user on this call (cherry picked from commit cf295f0a1782a2cc0f577d46ff030454f661e604) https://bugzilla.redhat.com/show_bug.cgi?id=1618530 --- app/controllers/api/base_controller/generic.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/base_controller/generic.rb b/app/controllers/api/base_controller/generic.rb index 0c5bc08d28..11dcb0c0e0 100644 --- a/app/controllers/api/base_controller/generic.rb +++ b/app/controllers/api/base_controller/generic.rb @@ -65,10 +65,10 @@ def request_retire_resource(type, id, _data = nil) if api_user_role_allows?('miq_request_approval') klass = collection_class(type) if id - msg = "Retiring #{type} id #{id} immediately as a request." + msg = "#{User.current_user.userid} retiring #{type} id #{id} immediately as a request." resource = resource_search(id, type, klass) api_log_info(msg) - klass.make_retire_request(resource.id) + klass.make_retire_request(resource.id, User.current_user) else raise BadRequestError, "Must specify an id for retiring a #{type} resource" end