Skip to content

Delete error when having more than one note. #8

Open
@m6mmi

Description

@m6mmi

api/views.py have issue.

This should do the trick:

`class NoteDelete(generics.RetrieveUpdateDestroyAPIView):
serializer_class = NoteSerializer
permission_classes = [IsAuthenticated]

def get_object(self):
    user = self.request.user
    id = self.kwargs['pk']
    return Note.objects.get(author=user, id=id)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions