From 1b932dccbfd5814e7c2f6a813e6d9cebba6100ab Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Wed, 29 Jul 2020 10:21:38 +0200 Subject: [PATCH] rename key --- ffplayout/apps/api_player/utils.py | 4 ++-- ffplayout/apps/api_player/views.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ffplayout/apps/api_player/utils.py b/ffplayout/apps/api_player/utils.py index add0d567..e1657fa4 100644 --- a/ffplayout/apps/api_player/utils.py +++ b/ffplayout/apps/api_player/utils.py @@ -58,7 +58,7 @@ def write_json(data): if os.path.isfile(output) and data == read_json(data['date']): return Response({ - 'text': 'Playlist from {} already exists'.format(data['date']) + 'detail': 'Playlist from {} already exists'.format(data['date']) }, status=status.HTTP_204_NO_CONTENT) @@ -66,7 +66,7 @@ def write_json(data): json.dump(data, outfile, indent=4) return Response({ - 'text': 'Playlist from {} saved'.format(data['date']) + 'detail': 'Playlist from {} saved'.format(data['date']) }, status=status.HTTP_201_CREATED) diff --git a/ffplayout/apps/api_player/views.py b/ffplayout/apps/api_player/views.py index 2cf267fa..a1fe1269 100644 --- a/ffplayout/apps/api_player/views.py +++ b/ffplayout/apps/api_player/views.py @@ -169,10 +169,9 @@ class Playlist(APIView): def post(self, request, *args, **kwargs): if 'data' in request.data: - _respose = write_json(request.data['data']) - return _respose + return write_json(request.data['data']) - return Response({'text': 'Unspecified save error'}, + return Response({'detail': 'Unspecified save error'}, status=status.HTTP_400_BAD_REQUEST)