Skip to content

Commit 2233b18

Browse files
authored
fix(seer): Fix simple organization seer rpcs (#104483)
Seer passes `org_id` as an arg so this wrapper actually results in the same keyword arg being specified twice which is an error.
1 parent 2325ea3 commit 2233b18

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/sentry/seer/endpoints/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def map_org_id_param(func: Callable) -> Callable:
1313
"""
1414

1515
def wrapper(*, organization_id: int, **kwargs: Any) -> Any:
16-
return func(org_id=organization_id, **kwargs)
16+
kwargs["org_id"] = organization_id
17+
return func(**kwargs)
1718

1819
return wrapper
1920

tests/sentry/seer/endpoints/test_organization_seer_rpc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,12 @@ def test_org_read_permission(self) -> None:
157157

158158
assert response.status_code == 200
159159
assert response.data == {"slug": self.organization.slug}
160+
161+
@with_feature("organizations:seer-public-rpc")
162+
def test_org_level_method_duplicate_org_id(self) -> None:
163+
"""Test that organization-level methods work and return correct data"""
164+
path = self._get_path("get_organization_slug")
165+
response = self.client.post(path, data={"args": {"org_id": 1}}, format="json")
166+
167+
assert response.status_code == 200
168+
assert response.data == {"slug": self.organization.slug}

0 commit comments

Comments
 (0)