From 28a5491f46b53bfae061d57d4334a482c48b3a3a Mon Sep 17 00:00:00 2001 From: MU-Software Date: Tue, 24 Sep 2024 21:02:32 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=202023=EB=85=84=20=EA=B0=9C=EC=9D=B8?= =?UTF-8?q?=ED=9B=84=EC=9B=90=20API=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sponsor/viewsets.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sponsor/viewsets.py b/sponsor/viewsets.py index cb8d277..59d5f2a 100644 --- a/sponsor/viewsets.py +++ b/sponsor/viewsets.py @@ -1,26 +1,25 @@ from typing import Type -from django.db.transaction import atomic - from django.db.models import Prefetch -from django.shortcuts import get_object_or_404 +from django.db.transaction import atomic from django.db.utils import IntegrityError +from django.shortcuts import get_object_or_404 from rest_framework import mixins, status, viewsets -from rest_framework.response import Response from rest_framework.decorators import action +from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet, ViewSet -from sponsor.models import Patron, Sponsor, SponsorLevel, SponsorBenefit, BenefitByLevel +from sponsor.models import BenefitByLevel, Patron, Sponsor, SponsorBenefit, SponsorLevel from sponsor.permissions import IsOwnerOrReadOnly, OwnerOnly from sponsor.serializers import ( + BenefitByLevelSerializer, PatronListSerializer, + SponsorBenefitSerializer, SponsorDetailSerializer, + SponsorLevelSerializer, SponsorListSerializer, SponsorRemainingAccountSerializer, SponsorSerializer, - SponsorLevelSerializer, - SponsorBenefitSerializer, - BenefitByLevelSerializer, SponsorWithLevelSerializer, ) from sponsor.slack import send_new_sponsor_notification @@ -175,7 +174,7 @@ def list(self, request, *args, **kwargs): class PatronListViewSet(ViewSet): - def list(self, request): + def list(self, request, *args, **kwargs): queryset = Patron.objects.all() serializer = PatronListSerializer(queryset, many=True) return Response(serializer.data)