rename key
This commit is contained in:
parent
619ecd3e36
commit
1b932dccbf
@ -58,7 +58,7 @@ def write_json(data):
|
|||||||
|
|
||||||
if os.path.isfile(output) and data == read_json(data['date']):
|
if os.path.isfile(output) and data == read_json(data['date']):
|
||||||
return Response({
|
return Response({
|
||||||
'text': 'Playlist from {} already exists'.format(data['date'])
|
'detail': 'Playlist from {} already exists'.format(data['date'])
|
||||||
}, status=status.HTTP_204_NO_CONTENT)
|
}, status=status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ def write_json(data):
|
|||||||
json.dump(data, outfile, indent=4)
|
json.dump(data, outfile, indent=4)
|
||||||
|
|
||||||
return Response({
|
return Response({
|
||||||
'text': 'Playlist from {} saved'.format(data['date'])
|
'detail': 'Playlist from {} saved'.format(data['date'])
|
||||||
}, status=status.HTTP_201_CREATED)
|
}, status=status.HTTP_201_CREATED)
|
||||||
|
|
||||||
|
|
||||||
|
@ -169,10 +169,9 @@ class Playlist(APIView):
|
|||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
if 'data' in request.data:
|
if 'data' in request.data:
|
||||||
_respose = write_json(request.data['data'])
|
return write_json(request.data['data'])
|
||||||
return _respose
|
|
||||||
|
|
||||||
return Response({'text': 'Unspecified save error'},
|
return Response({'detail': 'Unspecified save error'},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user