mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-11 08:42:23 +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:
|
try:
|
||||||
view.check_permissions(request)
|
view.check_permissions(request)
|
||||||
view.check_object_permissions(request, obj)
|
if obj is not None:
|
||||||
|
view.check_object_permissions(request, obj)
|
||||||
except exceptions.APIException:
|
except exceptions.APIException:
|
||||||
return False # Doesn't have permissions
|
return False # Doesn't have permissions
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user