исправил ошибку при создании плейлиста
This commit is contained in:
parent
533128e1f3
commit
ab5cb655d9
|
|
@ -34,7 +34,8 @@ class PlayListViewSet(GenericViewSet):
|
|||
|
||||
@action(detail=False, methods=['post'], schema=PlayListSchema())
|
||||
def create_playlist(self, request):
|
||||
if request.data['name']:
|
||||
|
||||
if request.data.get('name', False):
|
||||
try:
|
||||
instance = PlayList.objects.get(pk=request.data['playlist_id'], user=request.user.pk)
|
||||
data = request.data
|
||||
|
|
|
|||
Loading…
Reference in New Issue