From def52057cdf17a63d3aaf6315d07676b52cceafe Mon Sep 17 00:00:00 2001 From: Eric Hasegawa Date: Tue, 12 Sep 2023 10:14:40 -0700 Subject: [PATCH] address comments --- .../endpoints/release_threshold_details.py | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/sentry/api/endpoints/release_threshold_details.py b/src/sentry/api/endpoints/release_threshold_details.py index 7b1cf38fb85b5..1f739d2784228 100644 --- a/src/sentry/api/endpoints/release_threshold_details.py +++ b/src/sentry/api/endpoints/release_threshold_details.py @@ -1,5 +1,4 @@ from django.http import HttpResponse -from rest_framework import serializers from rest_framework.request import Request from rest_framework.response import Response @@ -8,16 +7,10 @@ from sentry.api.base import region_silo_endpoint from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize -from sentry.api.serializers.rest_framework.project import ProjectField from sentry.models import Project from sentry.models.release_threshold.releasethreshold import ReleaseThreshold -class ReleaseThresholdDetailsGETSerializer(serializers.Serializer): - threshold_id = serializers.CharField() - project = ProjectField() - - @region_silo_endpoint class ReleaseThresholdDetailsEndpoint(ProjectEndpoint): owner: ApiOwner = ApiOwner.ENTERPRISE @@ -26,21 +19,9 @@ class ReleaseThresholdDetailsEndpoint(ProjectEndpoint): } def get(self, request: Request, project: Project, threshold_id: str) -> HttpResponse: - request.data["project"] = project.slug - request.data["threshold_id"] = threshold_id - serializer = ReleaseThresholdDetailsGETSerializer( - data=request.data, - context={ - "organization": project.organization, - "access": request.access, - }, - ) - if not serializer.is_valid(): - return Response(serializer.errors, status=400) - result = serializer.validated_data try: release_threshold = ReleaseThreshold.objects.get( - id=result.get("threshold_id"), + id=threshold_id, project=project, ) return Response(serialize(release_threshold, request.user), status=200)