Remove unnecessary single object selection

GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-12-14 11:20:19 -05:00
parent 4cefb8d06e
commit 3f9b2dadc8
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 0 additions and 2 deletions

View File

@ -51,8 +51,6 @@ module UserServlet
tmp_params = sanitize_params(params)
opts[:id] = tmp_params[:id] if tmp_params[:id]
data = get_db.update_user(opts)
# Only return the single object if the id parameter is present
data = data.first if !sanitized_params[:id].nil? && data.count == 1
set_json_data_response(response: data)
rescue => e
print_error_and_create_response(error: e, message: 'There was an error updating the user:', code: 500)