-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(wizard) Fix possibly unbound variable in setup wizard #59934
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
Conversation
There have been a few UnboundLocalError events captured which wouldn't happen with this approach. Fixes SENTRY-180Q
| return render_to_response("sentry/setup-wizard.html", context, request) | ||
|
|
||
|
|
||
| def get_token(mappings: List[OrganizationMapping], user: 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.
This typing can "just" be RpcUser now that request.user is never a User.
| for region_name, region_data in region_data_map.items(): | ||
| for key in region_data["keys"]: | ||
| serialized_key = { | ||
| "dsn": {"public": key.dsn_public}, | ||
| "isActive": key.is_active, | ||
| } | ||
| keys_map[key.project_id].append(serialized_key) |
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.
I was looking through this code earlier after seeing the issue. It looks like we can potentially flatten/combine a few of these loops that iterate over region_data_map. Is there any reason not to just inline this logic with the original region_data["keys"] set logic on line 97?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #59934 +/- ##
==========================================
- Coverage 80.77% 80.75% -0.02%
==========================================
Files 5176 5179 +3
Lines 227273 227387 +114
Branches 38252 38258 +6
==========================================
+ Hits 183580 183630 +50
- Misses 38119 38167 +48
- Partials 5574 5590 +16
|
There have been a few UnboundLocalError events captured which wouldn't happen with this approach.
Fixes SENTRY-180Q