mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Adjust patch
This commit is contained in:
parent
ad1e05b36a
commit
83c07fb1d5
|
@ -43,8 +43,8 @@ This will either raise a `PermissionDenied` or `NotAuthenticated` exception, or
|
|||
|
||||
For example:
|
||||
|
||||
def get_object(self, pk):
|
||||
obj = get_object_or_404(self.get_queryset(), pk=pk)
|
||||
def get_object(self):
|
||||
obj = get_object_or_404(self.get_queryset(), pk=self.kwargs["pk"])
|
||||
self.check_object_permissions(self.request, obj)
|
||||
return obj
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user