1. Matthew Schinckel
  2. django-rest-api


Matthew Schinckel  committed 512d79c

Revert the change: some old code still relies on getting a list as the content of the object get.

  • Participants
  • Parent commits c671586
  • Branches default

Comments (0)

Files changed (1)

File rest_api/options.py

View file
  • Ignore whitespace
         return self.queryset(request)
     def read(self, request, pk):
-        obj = self.queryset(request).get(pk=pk)
-        if self.has_view_permission(request, obj):
-            return obj
+        qs = self.queryset(request).filter(pk=pk)
+        if self.has_view_permission(request, qs.get()):
+            return qs
         raise http.Forbidden()
     def create(self, request):