Commit 03d95708 authored by 八千流's avatar 八千流 Committed by 老广

[Update] 优化用户API,创建用户添加组织关系 (#2776)

parent c300f0b5
...@@ -48,6 +48,9 @@ class UserViewSet(IDInCacheFilterMixin, BulkModelViewSet): ...@@ -48,6 +48,9 @@ class UserViewSet(IDInCacheFilterMixin, BulkModelViewSet):
def perform_create(self, serializer): def perform_create(self, serializer):
users = serializer.save() users = serializer.save()
for user in users:
if current_org and current_org.is_real():
user.orgs.add(current_org.id)
self.send_created_signal(users) self.send_created_signal(users)
def get_queryset(self): def get_queryset(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment