MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / is_valid

Method is_valid

apps/trigger/serializers/trigger.py:505–512  ·  view source on GitHub ↗
(self, *, raise_exception=False)

Source from the content-addressed store, hash-verified

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):

Callers 3

editMethod · 0.95
deleteMethod · 0.95
oneMethod · 0.95

Calls 3

AppApiExceptionClass · 0.90
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected