fix: 修复UserModel、RoleModel的admin属性与sqlalchemy表模型无法匹配的问题

This commit is contained in:
insistence
2024-01-24 20:52:40 +08:00
parent f0c38a87dc
commit 88de6058ef
5 changed files with 10 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ class RoleService:
:param page_object: 编辑角色对象
:return: 编辑角色校验结果
"""
edit_role = page_object.model_dump(exclude_unset=True)
edit_role = page_object.model_dump(exclude_unset=True, exclude={'admin'})
if page_object.type != 'status':
del edit_role['menu_ids']
if page_object.type == 'status':