изменил метод ретрив

This commit is contained in:
Mike0001-droid 2024-06-10 10:21:53 +05:00
parent ea90b191d0
commit 53f4cb6194
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class SongViewSet(ViewSet):
def retrieve(self, request, pk=None):
if request.user:
return Response(f"{request.user.pk}")
else:
return Response('Не авторизован', status=status.HTTP_401_UNAUTHORIZED)
user_pk = request.user.pk
song_obj = get_object_or_404(Song, azura_id=pk).pk