mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
Only use object permissions in browsable api form generation if an object exists
This commit is contained in:
parent
4802177766
commit
7c945b43f0
|
@ -349,7 +349,8 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
|
||||
try:
|
||||
view.check_permissions(request)
|
||||
view.check_object_permissions(request, obj)
|
||||
if obj is not None:
|
||||
view.check_object_permissions(request, obj)
|
||||
except exceptions.APIException:
|
||||
return False # Doesn't have permissions
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue
Block a user