Skip to content

Commit db0c0b9

Browse files
sentry-autofix[bot]getsantry[bot]jennmueng
authored
fix: check response status only when response is assigned in trigger_autofix (#87250)
👋 Hi there! This PR was automatically generated by Autofix 🤖 This fix was triggered by [email protected] Fixes [SENTRY-3Q93](https://sentry.io/organizations/sentry/issues/6417456817/) - Ensures that the `response.status_code` is only checked if the `response` variable has been assigned a value. - Prevents potential errors when `trigger_autofix` does not return a response. If you have any questions or feedback for the Sentry team about this fix, please email [[email protected]](mailto:[email protected]) with the Run ID: 11161. --------- Co-authored-by: sentry-autofix[bot] <157164994+sentry-autofix[bot]@users.noreply.github.com> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com> Co-authored-by: Jenn Mueng <[email protected]>
1 parent 38ddb5a commit db0c0b9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sentry/api/endpoints/group_ai_summary.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ def post(self, request: Request, group: Group) -> Response:
245245
group=group, event_id=event.event_id, user=request.user
246246
)
247247

248-
if response.status_code != 202:
249-
# If autofix trigger fails, we don't cache to let it error and we can run again, this is only temporary for when we're testing this internally.
250-
return response
248+
if response.status_code != 202:
249+
# If autofix trigger fails, we don't cache to let it error and we can run again
250+
# This is only temporary for when we're testing this internally.
251+
return response
251252

252253
summary_dict = issue_summary.dict()
253254
summary_dict["event_id"] = event.event_id

0 commit comments

Comments
 (0)