| 503 | workspace_id = serializers.CharField(required=True, label=_('workspace id')) |
| 504 | |
| 505 | def is_valid(self, *, raise_exception=False): |
| 506 | super().is_valid(raise_exception=True) |
| 507 | workspace_id = self.data.get('workspace_id') |
| 508 | query_set = QuerySet(Trigger).filter(id=self.data.get('trigger_id')) |
| 509 | if workspace_id: |
| 510 | query_set = query_set.filter(workspace_id=workspace_id) |
| 511 | if not query_set.exists(): |
| 512 | raise AppApiException(500, _('Trigger id does not exist')) |
| 513 | |
| 514 | @transaction.atomic |
| 515 | def edit(self, instance: Dict, with_valid=True): |