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

Method is_valid

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

Source from the content-addressed store, hash-verified

1150 image = UploadedImageField(required=True, label=_("picture"))
1151
1152 def is_valid(self, *, raise_exception=False):
1153 super().is_valid(raise_exception=True)
1154 workspace_id = self.data.get("workspace_id")
1155 query_set = QuerySet(Tool).filter(id=self.data.get("id"))
1156 if workspace_id:
1157 query_set = query_set.filter(workspace_id=workspace_id)
1158 if not query_set.exists():
1159 raise AppApiException(500, _("Tool id does not exist"))
1160
1161 def edit(self, with_valid=True):
1162 if with_valid:

Callers 1

editMethod · 0.95

Calls 3

AppApiExceptionClass · 0.90
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected