fix: workspace add member
This commit is contained in:
parent
9f0b0c1247
commit
1f5587eeeb
@ -468,7 +468,11 @@ class UserManageSerializer(serializers.Serializer):
|
|||||||
user_role_relations = (
|
user_role_relations = (
|
||||||
user_role_relation_model.objects
|
user_role_relation_model.objects
|
||||||
.filter(workspace_id=workspace_id, role__type='USER')
|
.filter(workspace_id=workspace_id, role__type='USER')
|
||||||
.select_related('role', 'user') # 预加载外键数据
|
.exclude(user__in=user_role_relation_model.objects
|
||||||
|
.filter(workspace_id=workspace_id)
|
||||||
|
.exclude(role__type='USER')
|
||||||
|
.values_list('user', flat=True))
|
||||||
|
.select_related('role', 'user')
|
||||||
)
|
)
|
||||||
user_dict = {}
|
user_dict = {}
|
||||||
for relation in user_role_relations:
|
for relation in user_role_relations:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user