Only use object permissions in browsable api form generation if an object exists

This commit is contained in:
Tom Christie 2013-05-18 23:52:02 +01:00
parent 4802177766
commit 7c945b43f0

View File

@ -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