Update get_object() example in permissions.md (#5401)

* Update get_object() example in permissions.md 

I'm a bit confused about the example that's provided in the 'Object level permissions' section.  Other examples (e.g. Tutorial 3 - Class Based Views) provided a pk to get_object().  It doesn't seem like this example has any way of identifying a specific object.  

Just in case I'm correct, I've prepared this pull request. But if I'm wrong, would it be possible for you to explain the example I modified?  

Many Thanks...

* Adjust patch
This commit is contained in:
Sanjuro Jogdeo 2017-09-08 09:51:16 -07:00 committed by Carlton Gibson
parent 13222e45bc
commit 0e341c24b4

View File

@ -44,7 +44,7 @@ This will either raise a `PermissionDenied` or `NotAuthenticated` exception, or
For example:
def get_object(self):
obj = get_object_or_404(self.get_queryset())
obj = get_object_or_404(self.get_queryset(), pk=self.kwargs["pk"])
self.check_object_permissions(self.request, obj)
return obj