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