(self, *, raise_exception=False)
| 1150 | image = UploadedImageField(required=True, label=_("picture")) |
| 1151 | |
| 1152 | def is_valid(self, *, raise_exception=False): |
| 1153 | super().is_valid(raise_exception=True) |
| 1154 | workspace_id = self.data.get("workspace_id") |
| 1155 | query_set = QuerySet(Tool).filter(id=self.data.get("id")) |
| 1156 | if workspace_id: |
| 1157 | query_set = query_set.filter(workspace_id=workspace_id) |
| 1158 | if not query_set.exists(): |
| 1159 | raise AppApiException(500, _("Tool id does not exist")) |
| 1160 | |
| 1161 | def edit(self, with_valid=True): |
| 1162 | if with_valid: |
no test coverage detected