fix: 修复logger.error堆栈问题

This commit is contained in:
Bai
2023-02-20 16:01:48 +08:00
committed by Jiangjie.Bai
parent d246b9bb35
commit 8ab01931fb

View File

@@ -97,10 +97,10 @@ class RBACPermission(permissions.DjangoModelPermissions):
else:
model_cls = queryset.model
except AssertionError as e:
logger.error('Error get model cls: ', e)
logger.error(f'Error get model cls: {e}')
model_cls = None
except AttributeError as e:
logger.error('Error get model cls: ', e)
logger.error(f'Error get model cls: {e}')
model_cls = None
except Exception as e:
logger.error('Error get model class: {} of {}'.format(e, view))