(self, *, raise_exception=False)
| 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: |
no test coverage detected