(self, *, raise_exception=False)
| 617 | workspace_id = serializers.CharField(required=True, label=_("workspace id")) |
| 618 | |
| 619 | def is_one_valid(self, *, raise_exception=False): |
| 620 | super().is_valid(raise_exception=True) |
| 621 | workspace_id = self.data.get("workspace_id") |
| 622 | query_set = QuerySet(Tool).filter(id=self.data.get("id")) |
| 623 | if workspace_id: |
| 624 | query_set = query_set.filter(workspace_id=workspace_id) |
| 625 | if not query_set.exists(): |
| 626 | get_authorized_tool = DatabaseModelManage.get_model("get_authorized_tool") |
| 627 | if get_authorized_tool: |
| 628 | if not get_authorized_tool(QuerySet(Tool).filter(id=self.data.get("id")), workspace_id).exists(): |
| 629 | raise AppApiException(500, _("Tool id does not exist")) |
| 630 | |
| 631 | def is_valid(self, *, raise_exception=False): |
| 632 | super().is_valid(raise_exception=True) |
no test coverage detected