Skip to content

Commit 387f1eb

Browse files
authored
chore(hybrid-cloud): Update OrganizationAuditLogsEndpoint to be a control silo endpoint (#54755)
1 parent 6f2c9ec commit 387f1eb

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/sentry/api/endpoints/organization_auditlogs.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44

55
from sentry import audit_log
66
from sentry.api.base import control_silo_endpoint
7-
from sentry.api.bases import OrganizationEndpoint
7+
from sentry.api.bases import ControlSiloOrganizationEndpoint
88
from sentry.api.bases.organization import OrganizationAuditPermission
99
from sentry.api.paginator import DateTimePaginator
1010
from sentry.api.serializers import serialize
1111
from sentry.audit_log.manager import AuditLogEventNotRegistered
1212
from sentry.db.models.fields.bounded import BoundedIntegerField
1313
from sentry.models import AuditLogEntry
14+
from sentry.services.hybrid_cloud.organization.model import (
15+
RpcOrganization,
16+
RpcUserOrganizationContext,
17+
)
1418

1519

1620
class AuditLogQueryParamSerializer(serializers.Serializer):
@@ -26,10 +30,15 @@ def validate_event(self, event):
2630

2731

2832
@control_silo_endpoint
29-
class OrganizationAuditLogsEndpoint(OrganizationEndpoint):
33+
class OrganizationAuditLogsEndpoint(ControlSiloOrganizationEndpoint):
3034
permission_classes = (OrganizationAuditPermission,)
3135

32-
def get(self, request: Request, organization) -> Response:
36+
def get(
37+
self,
38+
request: Request,
39+
organization_context: RpcUserOrganizationContext,
40+
organization: RpcOrganization,
41+
) -> Response:
3342
queryset = AuditLogEntry.objects.filter(organization_id=organization.id).select_related(
3443
"actor"
3544
)

0 commit comments

Comments
 (0)