еще один рефакторинг

This commit is contained in:
Mike0001-droid 2024-06-10 16:37:11 +05:00
parent 090d14b8e6
commit 3486aa481f
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ from django.shortcuts import get_object_or_404, get_list_or_404
from rest_framework.permissions import IsAuthenticated
from decouple import config
from urllib.parse import urljoin
from django.http import HttpRequest
import requests
from .schemas import SongSchema, DeleteSongSchema
@ -23,7 +24,7 @@ class SongViewSet(GenericViewSet):
songs_pk = FavoriteSong.objects.filter(user=request.user, song__isnull=False).values_list('song_id', flat=True)
queryset = Song.objects.filter(id__in=songs_pk)
serializer = SongSerializer(queryset, many=True)
return Response(f"{request.build_absolute_uri()}")
return Response(f"{HttpRequest.build_absolute_uri()}")
def retrieve(self, request, pk=None):
try: