diff --git a/apps/rbac/permissions.py b/apps/rbac/permissions.py index 3b59a4812..1feade002 100644 --- a/apps/rbac/permissions.py +++ b/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