Skip to content

Commit

Permalink
Merge pull request #166 from pythonkr/fix/sponsor-api-versioning
Browse files Browse the repository at this point in the history
Fix: 해당 연도의 후원사 정보만 쿼리하도록 수정
  • Loading branch information
jungmir authored Sep 20, 2024
2 parents cc8c4e2 + 946be07 commit 3a565ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sponsor/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SponsorLevelViewSet(ModelViewSet):
http_method_names = ["get", "post", "put", "delete"]

def get_queryset(self):
return SponsorLevel.objects.get_queryset()
return SponsorLevel.objects.filter(year=self.request.version).get_queryset()

def get_serializer_class(self):
match self.action:
Expand Down Expand Up @@ -159,7 +159,7 @@ class SponsorRemainingAccountViewSet(ModelViewSet):
http_method_names = ["get"]

def get_queryset(self):
return SponsorLevel.objects.all()
return SponsorLevel.objects.filter(year=self.request.version).all()

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

0 comments on commit 3a565ce

Please sign in to comment.