mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-26 15:25:55 +00:00
fix: 修改AuthBook删除raise异常类
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
from django.db import models, transaction
|
||||
from django.db.models import Max
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
|
||||
from orgs.mixins.models import OrgManager
|
||||
from .base import BaseUser
|
||||
@@ -14,7 +15,7 @@ __all__ = ['AuthBook']
|
||||
class AuthBookQuerySet(models.QuerySet):
|
||||
def delete(self):
|
||||
if self.count() > 1:
|
||||
raise PermissionError(_("Bulk delete deny"))
|
||||
raise PermissionDenied(_("Bulk delete deny"))
|
||||
return super().delete()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user