Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f5831297
Commit
f5831297
authored
Apr 14, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Sentry program context even without a current user
parent
95a867e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+10
-8
No files found.
app/controllers/application_controller.rb
View file @
f5831297
...
@@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
...
@@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
before_action
:check_password_expiration
before_action
:check_password_expiration
before_action
:check_2fa_requirement
before_action
:check_2fa_requirement
before_action
:ldap_security_check
before_action
:ldap_security_check
before_action
:sentry_
user_
context
before_action
:sentry_context
before_action
:default_headers
before_action
:default_headers
before_action
:add_gon_variables
before_action
:add_gon_variables
before_action
:configure_permitted_parameters
,
if: :devise_controller?
before_action
:configure_permitted_parameters
,
if: :devise_controller?
...
@@ -41,13 +41,15 @@ class ApplicationController < ActionController::Base
...
@@ -41,13 +41,15 @@ class ApplicationController < ActionController::Base
protected
protected
def
sentry_user_context
def
sentry_context
if
Rails
.
env
.
production?
&&
current_application_settings
.
sentry_enabled
&&
current_user
if
Rails
.
env
.
production?
&&
current_application_settings
.
sentry_enabled
if
current_user
Raven
.
user_context
(
Raven
.
user_context
(
id:
current_user
.
id
,
id:
current_user
.
id
,
email:
current_user
.
email
,
email:
current_user
.
email
,
username:
current_user
.
username
,
username:
current_user
.
username
,
)
)
end
Raven
.
tags_context
(
program:
sentry_program_context
)
Raven
.
tags_context
(
program:
sentry_program_context
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment