summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-12-14 13:32:55 -0600
committerRobert Speicher <rspeicher@gmail.com>2017-12-19 15:45:08 -0600
commit3e4b45fc216875ff25647675d92448a53a740d9b (patch)
tree836b9459d674c2aa0c34e63ed3f4c55999729d1f /app/services
parent8d0ad36bcfc0ef95ee9a116604ba1516367dbb27 (diff)
downloadgitlab-ce-3e4b45fc216875ff25647675d92448a53a740d9b.tar.gz
Only include the user's ID in the time_spent command's update hash
Previously, this would include the entire User record in the update hash, which was rendered in the response using `to_json`, erroneously exposing every attribute of that record, including their (now removed) private token. Now we only include the user ID, and perform the lookup on-demand.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/quick_actions/interpret_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index 06ac86cd5a9..669c1ba0a22 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -405,7 +405,7 @@ module QuickActions
if time_spent
@updates[:spend_time] = {
duration: time_spent,
- user: current_user,
+ user_id: current_user.id,
spent_at: time_spent_date
}
end
@@ -428,7 +428,7 @@ module QuickActions
current_user.can?(:"admin_#{issuable.to_ability_name}", project)
end
command :remove_time_spent do
- @updates[:spend_time] = { duration: :reset, user: current_user }
+ @updates[:spend_time] = { duration: :reset, user_id: current_user.id }
end
desc "Append the comment with #{SHRUG}"