mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-30 21:44:04 +03:00
Update views.py
Override APIView get_permissions
This commit is contained in:
parent
b7523f4b9f
commit
54e9c37f5b
|
@ -275,8 +275,12 @@ class APIView(View):
|
||||||
"""
|
"""
|
||||||
Instantiates and returns the list of permissions that this view requires.
|
Instantiates and returns the list of permissions that this view requires.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
|
return [permission() for permission in self.permission_classes_by_action[self.action]]
|
||||||
|
except Exception:
|
||||||
return [permission() for permission in self.permission_classes]
|
return [permission() for permission in self.permission_classes]
|
||||||
|
|
||||||
|
|
||||||
def get_throttles(self):
|
def get_throttles(self):
|
||||||
"""
|
"""
|
||||||
Instantiates and returns the list of throttles that this view uses.
|
Instantiates and returns the list of throttles that this view uses.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user