-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Don't show detailed errors for anonymous users #956
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
=======================================
Coverage 96.24% 96.24%
=======================================
Files 826 826
Lines 19020 19023 +3
=======================================
+ Hits 18306 18309 +3
Misses 714 714
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
@@ -300,9 +302,11 @@ def context_value(self, request, *_): | |||
} | |||
|
|||
def error_formatter(self, error, debug=False): | |||
user = self.request.user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if user is a "none" value wouldn't line 306 return a can't access on undefined error?
maybe we could do a self.request.get("user",{})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really! request.user is automatically populated by the AuthenticationMiddleware middleware, it exists in all requests as an instance of User or AnonymousUser, and fwiw we're not checking for user anywhere else in the view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it! Thanks for clarifying
Purpose/Motivation
What is the feature? Why is this being done?
Links to relevant tickets
https://github.com/codecov/internal-issues/issues/915
What does this PR do?
Include a brief description of the changes in this PR. Bullet points are your friend.
Notes to Reviewer
Anything to note to the team? Any tips on how to review, or where to start?
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.