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

Method is_valid

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

Source from the content-addressed store, hash-verified

236 content = serializers.CharField(required=False, label=_('content'))
237
238 def is_valid(self, *, raise_exception=False):
239 super().is_valid(raise_exception=True)
240 workspace_id = self.data.get('workspace_id')
241 query_set = QuerySet(Knowledge).filter(id=self.data.get('knowledge_id'))
242 if workspace_id:
243 query_set = query_set.filter(workspace_id=workspace_id)
244 if not query_set.exists():
245 raise AppApiException(500, _('Knowledge id does not exist'))
246
247 def get_query_set(self):
248 self.is_valid()

Callers 6

get_query_setMethod · 0.95
is_validMethod · 0.45
associationMethod · 0.45
is_validMethod · 0.45
is_validMethod · 0.45
batchMethod · 0.45

Calls 2

AppApiExceptionClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected