Revert redundant change

This commit is contained in:
Bruno Alla 2024-08-30 22:52:55 +01:00
parent 63ce5c9414
commit f7e8556eec
No known key found for this signature in database

View File

@ -8,7 +8,6 @@ methods on viewsets that should be included by routers.
"""
import types
from django import VERSION as DJANGO_VERSION
from django.forms.utils import pretty_name
from rest_framework.views import APIView
@ -74,11 +73,6 @@ def api_view(http_method_names=None):
WrappedAPIView.schema = getattr(func, 'schema',
APIView.schema)
# Exempt all DRF views from Django's LoginRequiredMiddleware. Users should set
# DEFAULT_PERMISSION_CLASSES to 'rest_framework.permissions.IsAuthenticated' instead
if DJANGO_VERSION >= (5, 1):
func.login_required = False
return WrappedAPIView.as_view()
return decorator