Remove redundant query.
This commit is contained in:
parent
855c747155
commit
0a6422afcd
1 changed files with 1 additions and 2 deletions
|
@ -96,9 +96,8 @@ class MakeRequest(APIView):
|
||||||
def post(self, request, format=None):
|
def post(self, request, format=None):
|
||||||
serializer = MakeRequestSerializer(data=request.data)
|
serializer = MakeRequestSerializer(data=request.data)
|
||||||
if serializer.is_valid():
|
if serializer.is_valid():
|
||||||
profile = RadioProfile.objects.get(user=request.user)
|
|
||||||
try:
|
try:
|
||||||
profile.make_request(serializer.data['song'])
|
request.user.profile.make_request(serializer.data['song'])
|
||||||
except MakeRequestError as e:
|
except MakeRequestError as e:
|
||||||
return Response({'detail': str(e)},
|
return Response({'detail': str(e)},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
Loading…
Reference in a new issue