From af843231d978c1cc70add8dba4e86908673c5747 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 21 Feb 2023 10:45:00 +0100 Subject: [PATCH] Add user details to RemoteEvaluationsController --- app/controllers/remote_evaluation_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/remote_evaluation_controller.rb b/app/controllers/remote_evaluation_controller.rb index 970844a3..d89a6bfa 100644 --- a/app/controllers/remote_evaluation_controller.rb +++ b/app/controllers/remote_evaluation_controller.rb @@ -6,6 +6,7 @@ class RemoteEvaluationController < ApplicationController skip_after_action :verify_authorized skip_before_action :verify_authenticity_token + skip_before_action :set_sentry_context # POST /evaluate def evaluate @@ -77,6 +78,12 @@ class RemoteEvaluationController < ApplicationController private :create_and_score_submission def build_submission_params(cause, remote_evaluation_mapping) + Sentry.set_user( + id: remote_evaluation_mapping.user_id, + type: remote_evaluation_mapping.user_type, + consumer: remote_evaluation_mapping.user.consumer&.name + ) + files_attributes = remote_evaluation_params[:files_attributes] submission_params = remote_evaluation_params.except(:validation_token) submission_params[:exercise_id] = remote_evaluation_mapping.exercise_id