Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/sentry/overwatch/endpoints/overwatch_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ def get(self, request: Request) -> Response:
return Response(
data={
"organizations": [
{"org_id": org.id, "has_consent": _can_use_prevent_ai_features(org)}
{
"org_id": org.id,
"org_slug": org.slug,
"org_name": org.name,
"has_consent": _can_use_prevent_ai_features(org),
}
for org in organizations
]
}
Expand Down
14 changes: 12 additions & 2 deletions tests/sentry/overwatch/endpoints/test_overwatch_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,18 @@ def test_returns_org_ids_with_consent(self):
assert resp.status_code == 200
# Should return both orgs with their consent status
expected_orgs = [
{"org_id": org_with_consent.id, "has_consent": True},
{"org_id": org_without_consent.id, "has_consent": False},
{
"org_id": org_with_consent.id,
"org_slug": org_with_consent.slug,
"org_name": org_with_consent.name,
"has_consent": True,
},
{
"org_id": org_without_consent.id,
"org_slug": org_without_consent.slug,
"org_name": org_without_consent.name,
"has_consent": False,
},
]
# Sort both lists by org_id to ensure consistent comparison
expected_orgs = sorted(expected_orgs, key=lambda x: x["org_id"])
Expand Down
Loading