block: fix: .exists()

This commit is contained in:
starnakin 2023-12-28 11:32:49 +01:00
parent 9f7b813292
commit 4739afbaf0

View File

@ -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)