Skip to content

Commit 3a565ce

Browse files
authored
Merge pull request #166 from pythonkr/fix/sponsor-api-versioning
Fix: 해당 연도의 후원사 정보만 쿼리하도록 수정
2 parents cc8c4e2 + 946be07 commit 3a565ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sponsor/viewsets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SponsorLevelViewSet(ModelViewSet):
4040
http_method_names = ["get", "post", "put", "delete"]
4141

4242
def get_queryset(self):
43-
return SponsorLevel.objects.get_queryset()
43+
return SponsorLevel.objects.filter(year=self.request.version).get_queryset()
4444

4545
def get_serializer_class(self):
4646
match self.action:
@@ -159,7 +159,7 @@ class SponsorRemainingAccountViewSet(ModelViewSet):
159159
http_method_names = ["get"]
160160

161161
def get_queryset(self):
162-
return SponsorLevel.objects.all()
162+
return SponsorLevel.objects.filter(year=self.request.version).all()
163163

164164
def list(self, request, *args, **kwargs):
165165
queryset = SponsorLevel.objects.all().order_by("-price")

0 commit comments

Comments
 (0)