Skip to content

Commit

Permalink
Updated to DRF 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlton Gibson committed Dec 15, 2014
1 parent dc7d831 commit 2989876
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions snippets/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True

method = request.method

# Write permissions are only allowed to the owner of the snippet
return obj.owner == request.user

4 changes: 2 additions & 2 deletions snippets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class SnippetViewSet(viewsets.ModelViewSet):
"""
queryset = Snippet.objects.all()
serializer_class = SnippetSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
# IsOwnerOrReadOnly,)
permission_classes = (permissions.IsAuthenticatedOrReadOnly,
IsOwnerOrReadOnly,)

@detail_route(renderer_classes=(renderers.StaticHTMLRenderer,))
def highlight(self, request, *args, **kwargs):
Expand Down

0 comments on commit 2989876

Please sign in to comment.