mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
Merge 0a3e911301
into 12576275c4
This commit is contained in:
commit
063873fac4
|
@ -88,9 +88,7 @@ class SchemaGenerator(object):
|
|||
|
||||
if request is not None:
|
||||
view.request = clone_request(request, method)
|
||||
try:
|
||||
view.check_permissions(view.request)
|
||||
except exceptions.APIException:
|
||||
if not self.check_view_permission(view):
|
||||
continue
|
||||
else:
|
||||
view.request = None
|
||||
|
@ -165,6 +163,13 @@ class SchemaGenerator(object):
|
|||
|
||||
return True
|
||||
|
||||
def check_view_permission(self, view):
|
||||
try:
|
||||
view.check_permissions(view.request)
|
||||
except exceptions.APIException:
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_allowed_methods(self, callback):
|
||||
"""
|
||||
Return a list of the valid HTTP methods for this endpoint.
|
||||
|
|
Loading…
Reference in New Issue
Block a user