Bring keywrod args in line with Django's implementation

This commit is contained in:
Tom Christie 2012-11-14 19:34:19 +00:00
parent 0cfb27b40e
commit 647abcdb16

View File

@ -92,11 +92,11 @@ class SingleObjectAPIView(SingleObjectMixin, GenericAPIView):
pk_url_kwarg = 'pk' # Not provided in Django 1.3 pk_url_kwarg = 'pk' # Not provided in Django 1.3
slug_url_kwarg = 'slug' # Not provided in Django 1.3 slug_url_kwarg = 'slug' # Not provided in Django 1.3
def get_object(self): def get_object(self, queryset=None):
""" """
Override default to add support for object-level permissions. Override default to add support for object-level permissions.
""" """
obj = super(SingleObjectAPIView, self).get_object() obj = super(SingleObjectAPIView, self).get_object(queryset)
if not self.has_permission(self.request, obj): if not self.has_permission(self.request, obj):
self.permission_denied(self.request) self.permission_denied(self.request)
return obj return obj