| 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) |
| 633 | workspace_id = self.data.get("workspace_id") |
| 634 | query_set = QuerySet(Tool).filter(id=self.data.get("id")) |
| 635 | if workspace_id: |
| 636 | query_set = query_set.filter(workspace_id=workspace_id) |
| 637 | if not query_set.exists(): |
| 638 | raise AppApiException(500, _("Tool id does not exist")) |
| 639 | |
| 640 | @transaction.atomic |
| 641 | def edit(self, instance, with_valid=True): |