Skip to content
Snippets Groups Projects
Commit 95ce4d29 authored by Stan Hu's avatar Stan Hu
Browse files

Merge branch 'rs-sentry-contexts' into 'master'

Add Sentry program context even without a current user



See merge request !3729
parents 1f0274e5 f5831297
No related branches found
No related tags found
1 merge request!3729Add Sentry program context even without a current user
Pipeline #
Loading
Loading
@@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
before_action :check_password_expiration
before_action :check_2fa_requirement
before_action :ldap_security_check
before_action :sentry_user_context
before_action :sentry_context
before_action :default_headers
before_action :add_gon_variables
before_action :configure_permitted_parameters, if: :devise_controller?
Loading
Loading
@@ -41,13 +41,15 @@ class ApplicationController < ActionController::Base
 
protected
 
def sentry_user_context
if Rails.env.production? && current_application_settings.sentry_enabled && current_user
Raven.user_context(
id: current_user.id,
email: current_user.email,
username: current_user.username,
)
def sentry_context
if Rails.env.production? && current_application_settings.sentry_enabled
if current_user
Raven.user_context(
id: current_user.id,
email: current_user.email,
username: current_user.username,
)
end
 
Raven.tags_context(program: sentry_program_context)
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment