fix: 修改AuthBook删除raise异常类

This commit is contained in:
Bai
2021-06-16 14:41:00 +08:00
committed by Jiangjie.Bai
parent a3d02decd6
commit c4af78c9f0
2 changed files with 5 additions and 3 deletions

View File

@@ -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()