4
4
5
5
from sentry import audit_log
6
6
from sentry .api .base import control_silo_endpoint
7
- from sentry .api .bases import OrganizationEndpoint
7
+ from sentry .api .bases import ControlSiloOrganizationEndpoint
8
8
from sentry .api .bases .organization import OrganizationAuditPermission
9
9
from sentry .api .paginator import DateTimePaginator
10
10
from sentry .api .serializers import serialize
11
11
from sentry .audit_log .manager import AuditLogEventNotRegistered
12
12
from sentry .db .models .fields .bounded import BoundedIntegerField
13
13
from sentry .models import AuditLogEntry
14
+ from sentry .services .hybrid_cloud .organization .model import (
15
+ RpcOrganization ,
16
+ RpcUserOrganizationContext ,
17
+ )
14
18
15
19
16
20
class AuditLogQueryParamSerializer (serializers .Serializer ):
@@ -26,10 +30,15 @@ def validate_event(self, event):
26
30
27
31
28
32
@control_silo_endpoint
29
- class OrganizationAuditLogsEndpoint (OrganizationEndpoint ):
33
+ class OrganizationAuditLogsEndpoint (ControlSiloOrganizationEndpoint ):
30
34
permission_classes = (OrganizationAuditPermission ,)
31
35
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 :
33
42
queryset = AuditLogEntry .objects .filter (organization_id = organization .id ).select_related (
34
43
"actor"
35
44
)
0 commit comments