Skip to content

Commit

Permalink
Merge branch 'priscila/ref/project-added/add-audit-log' into priscila…
Browse files Browse the repository at this point in the history
…/ref/project-added/add-audit-log-frontend
  • Loading branch information
priscilawebdev authored Jan 10, 2025
2 parents c6ffda0 + a99c85c commit 01308db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/sentry/api/endpoints/organization_projects_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import random
import string
from email.headerregistry import Address
from typing import TypedDict

from django.contrib.auth.models import AnonymousUser
from django.db import IntegrityError, router, transaction
Expand Down Expand Up @@ -53,6 +54,12 @@ class OrgProjectPermission(OrganizationPermission):
}


class AuditData(TypedDict):
request: Request
organization: Organization
target_object: int


@region_silo_endpoint
class OrganizationProjectsExperimentEndpoint(OrganizationEndpoint):
publish_status = {
Expand Down Expand Up @@ -173,7 +180,7 @@ def post(self, request: Request, organization: Organization) -> Response:
data=team.get_audit_log_data(),
)

common_audit_data = {
common_audit_data: AuditData = {
"request": request,
"organization": team.organization,
"target_object": project.id,
Expand Down
10 changes: 9 additions & 1 deletion src/sentry/api/endpoints/team_projects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
from typing import TypedDict

from django.db import IntegrityError, router, transaction
from drf_spectacular.utils import OpenApiResponse, extend_schema
Expand All @@ -23,6 +24,7 @@
from sentry.apidocs.parameters import CursorQueryParam, GlobalParams
from sentry.apidocs.utils import inline_sentry_response_serializer
from sentry.constants import PROJECT_SLUG_MAX_LENGTH, RESERVED_PROJECT_SLUGS, ObjectStatus
from sentry.models.organization import Organization
from sentry.models.project import Project
from sentry.models.team import Team
from sentry.seer.similarity.utils import project_is_seer_eligible
Expand Down Expand Up @@ -84,6 +86,12 @@ class TeamProjectPermission(TeamPermission):
}


class AuditData(TypedDict):
request: Request
organization: Organization
target_object: int


@extend_schema(tags=["Teams"])
@region_silo_endpoint
class TeamProjectsEndpoint(TeamEndpoint, EnvironmentMixin):
Expand Down Expand Up @@ -206,7 +214,7 @@ def post(self, request: Request, team: Team) -> Response:

set_default_symbol_sources(project)

common_audit_data = {
common_audit_data: AuditData = {
"request": request,
"organization": team.organization,
"target_object": project.id,
Expand Down

0 comments on commit 01308db

Please sign in to comment.