MCPcopy
hub / github.com/1Panel-dev/MaxKB / is_valid

Method is_valid

apps/tools/serializers/tool.py:631–638  ·  view source on GitHub ↗
(self, *, raise_exception=False)

Source from the content-addressed store, hash-verified

629 raise AppApiException(500, _("Tool id does not exist"))
630
631 def is_valid(self, *, raise_exception=False):
632 super().is_valid(raise_exception=True)
633 workspace_id = self.data.get("workspace_id")
634 query_set = QuerySet(Tool).filter(id=self.data.get("id"))
635 if workspace_id:
636 query_set = query_set.filter(workspace_id=workspace_id)
637 if not query_set.exists():
638 raise AppApiException(500, _("Tool id does not exist"))
639
640 @transaction.atomic
641 def edit(self, instance, with_valid=True):

Callers 15

editMethod · 0.95
deleteMethod · 0.95
exportMethod · 0.95
oneMethod · 0.95
editMethod · 0.95
oneMethod · 0.95
deleteMethod · 0.95
getMethod · 0.95
deleteMethod · 0.95
insertMethod · 0.45
test_connectionMethod · 0.45
debugMethod · 0.45

Calls 2

AppApiExceptionClass · 0.90
getMethod · 0.45

Tested by 1

test_connectionMethod · 0.36