исправил ошибку во вью

This commit is contained in:
Mike0001-droid 2024-06-10 17:27:14 +05:00
parent 2e0d7f4e82
commit 6cf0d304a7
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class SongViewSet(GenericViewSet):
@action(detail=False, methods=['GET'], schema=DeleteSongSchema())
def check_is_favorite(self, request):
try:
song_obj = Song.objects.get(azura_id=request.data.get('azura_id'))
song_obj = Song.objects.get(azura_id=request.data.get('song_id'))
favorite_songs = FavoriteSong.objects.get(user=request.user, song=song_obj)
except ObjectDoesNotExist:
return Response({"error": 'Объекта не существует'}, status=status.HTTP_404_NOT_FOUND)