Commit 513e188c by Renzo Lucioni

Upgrade to DRF 3.5.4

3.5.4 features improved schema generation, including the ability to exclude views from generated schemas. 3.5.4 deprecates DjangoFilterBackend in favor of the implementation provided by the django-filter package.

LEARNER-1590
parent 50a0e1ab
......@@ -1034,7 +1034,7 @@ class QueryFacetFieldSerializer(serializers.Serializer):
path = '{path}?{query}'.format(path=request.path_info, query=query_params.urlencode())
url = request.build_absolute_uri(path)
return serializers.Hyperlink(url, name='narrow-url')
return serializers.Hyperlink(url, 'narrow-url')
class BaseHaystackFacetSerializer(HaystackFacetSerializer):
......
from django.db.models.functions import Lower
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import status, viewsets
from rest_framework.decorators import list_route
from rest_framework.filters import DjangoFilterBackend, OrderingFilter
from rest_framework.filters import OrderingFilter
from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated
from rest_framework.response import Response
......
from django.db.models.functions import Lower
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.filters import DjangoFilterBackend
from rest_framework.permissions import IsAuthenticated
from course_discovery.apps.api import filters, serializers
......
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.filters import DjangoFilterBackend
from rest_framework.permissions import IsAuthenticated
from course_discovery.apps.api import filters, serializers
......
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.filters import DjangoFilterBackend
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework_extensions.cache.mixins import CacheResponseMixin
......
......@@ -18,17 +18,10 @@ class SwaggerSchemaView(APIView):
SwaggerUIRenderer,
]
# Added in DRF 3.5.0. Does nothing until we upgrade.
exclude_from_schema = True
def get(self, request):
generator = SchemaGenerator(
title='Discovery API',
# TODO: Remove these kwargs after upgrading to DRF 3.5. exclude_from_schema
# will be sufficient at that point.
url='/api',
urlconf='course_discovery.apps.api.urls',
)
generator = SchemaGenerator(title='Discovery API')
schema = generator.get_schema(request=request)
if not schema:
......
......@@ -21,13 +21,13 @@ django-taggit==0.22.1
django-taggit-autosuggest==0.3.0
django-taggit-serializer==0.1.5
django-waffle==0.11.1
djangorestframework==3.4.7
djangorestframework==3.5.4
djangorestframework-csv==1.4.1
djangorestframework-jwt==1.8.0
djangorestframework-xml==1.3.0
django-rest-swagger==2.0.7
django-rest-swagger==2.1.2
drf-extensions==0.3.1
drf-haystack==1.6.0rc1
drf-haystack==1.6.1
dry-rest-permissions==0.1.6
edx-auth-backends==1.1.2
edx-ccx-keys==0.2.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment