Browse Source

fix: 修改显示 model 的错误

pull/9221/head
ibuler 2 years ago
parent
commit
c040564dc2
  1. 4
      apps/rbac/permissions.py

4
apps/rbac/permissions.py

@ -93,8 +93,10 @@ class RBACPermission(permissions.DjangoModelPermissions):
try:
queryset = self._queryset(view)
model_cls = queryset.model
except AssertionError:
model_cls = None
except Exception as e:
logger.error(e)
logger.error('Error get model class: {} of {}'.format(e, view))
model_cls = None
return model_cls

Loading…
Cancel
Save