Skip to content

Commit

Permalink
fix: 修复默认用户未添加默认角色的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jun 17, 2024
1 parent 3e158a0 commit 7865be8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/bisheng/database/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def add_user_and_default_role(cls, user: User) -> User:
session.refresh(user)
db_user_role = UserRole(user_id=user.user_id, role_id=DefaultRole)
session.add(db_user_role)
session.commit()
session.refresh(user)
return user

Expand Down

0 comments on commit 7865be8

Please sign in to comment.