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

Method is_valid

apps/knowledge/serializers/problem.py:141–148  ·  view source on GitHub ↗
(self, *, raise_exception=False)

Source from the content-addressed store, hash-verified

139 problem_id = serializers.UUIDField(required=True, label=_('problem id'))
140
141 def is_valid(self, *, raise_exception=False):
142 super().is_valid(raise_exception=True)
143 workspace_id = self.data.get('workspace_id')
144 query_set = QuerySet(Knowledge).filter(id=self.data.get('knowledge_id'))
145 if workspace_id:
146 query_set = query_set.filter(workspace_id=workspace_id)
147 if not query_set.exists():
148 raise AppApiException(500, _('Knowledge id does not exist'))
149
150 def list_paragraph(self, with_valid=True):
151 if with_valid:

Callers 4

list_paragraphMethod · 0.95
oneMethod · 0.95
deleteMethod · 0.95
editMethod · 0.95

Calls 3

AppApiExceptionClass · 0.90
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected