user info bug

This commit is contained in:
曹前明 2022-09-24 07:50:27 +08:00
parent 4ad64f8aa5
commit 3c633b6370
1 changed files with 1 additions and 1 deletions

View File

@ -511,7 +511,7 @@ class UserViewSet(CustomModelViewSet):
'roles': user.roles.values_list('name', flat=True), 'roles': user.roles.values_list('name', flat=True),
'avatar': user.avatar, 'avatar': user.avatar,
'perms': perms, 'perms': perms,
'belong_dept': user.belong_dept, 'belong_dept': user.belong_dept.id,
'post': user.post, 'post': user.post,
'belong_dept_name': user.belong_dept.name if user.belong_dept else '', 'belong_dept_name': user.belong_dept.name if user.belong_dept else '',
'post_name': user.post.name if user.post else '', 'post_name': user.post.name if user.post else '',