Browse Source

fix: playbook 批量删除 500 (#11022)

Co-authored-by: feng <1304903146@qq.com>
pull/11026/head
fit2bot 1 year ago committed by GitHub
parent
commit
1b0d23fbf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/ops/api/playbook.py

3
apps/ops/api/playbook.py

@ -4,6 +4,7 @@ import zipfile
from django.conf import settings
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from common.exceptions import JMSException
@ -12,7 +13,6 @@ from rbac.permissions import RBACPermission
from ..exception import PlaybookNoValidEntry
from ..models import Playbook
from ..serializers.playbook import PlaybookSerializer
from django.utils.translation import ugettext_lazy as _
__all__ = ["PlaybookViewSet", "PlaybookFileBrowserAPIView"]
@ -33,7 +33,6 @@ class PlaybookViewSet(OrgBulkModelViewSet):
search_fields = ('name', 'comment')
def perform_destroy(self, instance):
instance = self.get_object()
if instance.job_set.exists():
raise JMSException(code='playbook_has_job', detail={"msg": _("Currently playbook is being used in a job")})
instance_id = instance.id

Loading…
Cancel
Save