block: fix: .exists()
This commit is contained in:
parent
9f7b813292
commit
4739afbaf0
@ -12,7 +12,7 @@ class BlockView(APIView):
|
|||||||
|
|
||||||
def get(self, request, pk):
|
def get(self, request, pk):
|
||||||
block = BlockModel.objects.filter(pk=pk)
|
block = BlockModel.objects.filter(pk=pk)
|
||||||
if (block):
|
if (block.exists()):
|
||||||
return Response(serializers.serialize("json", block), status=status.HTTP_200_OK)
|
return Response(serializers.serialize("json", block), status=status.HTTP_200_OK)
|
||||||
else:
|
else:
|
||||||
return Response("Not Found", status=status.HTTP_404_NOT_FOUND)
|
return Response("Not Found", status=status.HTTP_404_NOT_FOUND)
|
||||||
|
Loading…
Reference in New Issue
Block a user