исправил ошибку во вью
This commit is contained in:
parent
2e0d7f4e82
commit
6cf0d304a7
|
|
@ -36,7 +36,7 @@ class SongViewSet(GenericViewSet):
|
||||||
@action(detail=False, methods=['GET'], schema=DeleteSongSchema())
|
@action(detail=False, methods=['GET'], schema=DeleteSongSchema())
|
||||||
def check_is_favorite(self, request):
|
def check_is_favorite(self, request):
|
||||||
try:
|
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)
|
favorite_songs = FavoriteSong.objects.get(user=request.user, song=song_obj)
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
return Response({"error": 'Объекта не существует'}, status=status.HTTP_404_NOT_FOUND)
|
return Response({"error": 'Объекта не существует'}, status=status.HTTP_404_NOT_FOUND)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue