(self, *, raise_exception=False)
| 198 | knowledge_id = serializers.UUIDField(required=True, label=_('knowledge id')) |
| 199 | |
| 200 | def is_valid(self, *, raise_exception=False): |
| 201 | super().is_valid(raise_exception=True) |
| 202 | workspace_id = self.data.get('workspace_id') |
| 203 | query_set = QuerySet(Knowledge).filter(id=self.data.get('knowledge_id')) |
| 204 | if workspace_id: |
| 205 | query_set = query_set.filter(workspace_id=workspace_id) |
| 206 | if not query_set.exists(): |
| 207 | raise AppApiException(500, _('Knowledge id does not exist')) |
| 208 | |
| 209 | def batch(self, problem_list, with_valid=True): |
| 210 | if with_valid: |
no test coverage detected