diff --git a/vrobbler/apps/scrobbles/api/serializers.py b/vrobbler/apps/scrobbles/api/serializers.py index b44a9d3..efc8a5a 100644 --- a/vrobbler/apps/scrobbles/api/serializers.py +++ b/vrobbler/apps/scrobbles/api/serializers.py @@ -20,9 +20,6 @@ class ScrobbleSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Scrobble fields = "__all__" - extra_kwargs = { - "url": {"view_name": "scrobble-detail", "lookup_field": "uuid"}, - } def update(self, instance, validated_data): note = validated_data.pop("note", None) diff --git a/vrobbler/apps/scrobbles/api/views.py b/vrobbler/apps/scrobbles/api/views.py index d000cf1..575fba1 100644 --- a/vrobbler/apps/scrobbles/api/views.py +++ b/vrobbler/apps/scrobbles/api/views.py @@ -23,13 +23,12 @@ class ScrobbleViewSet(viewsets.ModelViewSet): queryset = Scrobble.objects.all().order_by("-timestamp") serializer_class = ScrobbleSerializer permission_classes = [permissions.IsAuthenticated] - lookup_field = "uuid" def get_queryset(self): return super().get_queryset().filter(user=self.request.user) @action(detail=True, methods=["post"]) - def regenerate_share_token(self, request, uuid=None): + def regenerate_share_token(self, request, **kwargs): scrobble = self.get_object() scrobble.regenerate_share_token() return Response({"share_url": scrobble.get_share_url()})