def delete(self, request, id, format=None): FabricProfile = self.get_object(id) if FabricProfile.used: logger.error("This FabricProfile is being used by some fabric") return Response("FabricProfiles is in use", status=status.HTTP_400_BAD_REQUEST) else: FabricProfile.delete() logger.debug("FabricProfile record deleted successfully for id :"+str(id)) return Response(status=status.HTTP_204_NO_CONTENT)