Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
#212 Enable writing to the images API now that auth and perms are OK
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurty committed Apr 4, 2017
1 parent ff20f45 commit 8e765bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions icekit/images_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
Image = apps.get_model('icekit_plugins_image.Image')


class ImageViewSet(viewsets.ReadOnlyModelViewSet):
class ImageViewSet(viewsets.ModelViewSet):
"""
Read only viewset for image objects.
"""
pagination_class = ICEKitAPIPagination
serializer_class = serializers.ImageSerializer
# NOTE: `get_queryset` method is used instead of this `queryset` class
# attribute to return results, but we still need this defined here so
# the API router can auto-generate the right endpoint URL.
queryset = Image.objects.all()
# the API router can auto-generate the right endpoint URL and apply
# `DjangoModelPermissions`.
queryset = Image.objects.none()

def get_queryset(self):
return Image.objects.all()

0 comments on commit 8e765bf

Please sign in to comment.