Skip to content

Commit

Permalink
chore: add Add CompressedCacheResponseMixin to CourseRun Viewset (#4109)
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 authored Sep 26, 2023
1 parent 65db77f commit 861ebd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@


@ddt.ddt
@pytest.mark.usefixtures('django_cache')
class CourseRunViewSetTests(SerializationMixin, ElasticsearchTestMixin, OAuth2Mixin, APITestCase):
def setUp(self):
super().setUp()
Expand Down
3 changes: 2 additions & 1 deletion course_discovery/apps/api/v1/views/course_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from rest_framework.response import Response

from course_discovery.apps.api import filters, serializers
from course_discovery.apps.api.cache import CompressedCacheResponseMixin
from course_discovery.apps.api.mixins import ValidElasticSearchQueryRequiredMixin
from course_discovery.apps.api.pagination import ProxiedPagination
from course_discovery.apps.api.permissions import IsCourseRunEditorOrDjangoOrReadOnly
Expand Down Expand Up @@ -49,7 +50,7 @@ def inner(*args, **kwargs):


# pylint: disable=useless-super-delegation
class CourseRunViewSet(ValidElasticSearchQueryRequiredMixin, viewsets.ModelViewSet):
class CourseRunViewSet(CompressedCacheResponseMixin, ValidElasticSearchQueryRequiredMixin, viewsets.ModelViewSet):
""" CourseRun resource. """
filter_backends = (DjangoFilterBackend, OrderingFilter)
filterset_class = filters.CourseRunFilter
Expand Down

0 comments on commit 861ebd3

Please sign in to comment.