mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 21:10:13 +03:00
Don't override class variables in class methods kids ! Let's rather use Django's as_view
correctly.
This commit is contained in:
parent
216c77328c
commit
bbf4e8fa6d
|
@ -281,11 +281,7 @@ class APIRootView(views.APIView):
|
|||
"""
|
||||
_ignore_model_permissions = True
|
||||
exclude_from_schema = True
|
||||
|
||||
@classmethod
|
||||
def as_view(cls, **initkwargs):
|
||||
cls.api_root_dict = initkwargs.pop('api_root_dict', {})
|
||||
return super(APIRootView, cls).as_view(**initkwargs)
|
||||
api_root_dict = None
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
# Return a plain {"name": "hyperlink"} response.
|
||||
|
|
Loading…
Reference in New Issue
Block a user