mirror of https://github.com/jumpserver/jumpserver
[Update] 优化用户API,创建用户添加组织关系 (#2776)
parent
c300f0b549
commit
03d9570895
|
@ -48,6 +48,9 @@ class UserViewSet(IDInCacheFilterMixin, BulkModelViewSet):
|
|||
|
||||
def perform_create(self, serializer):
|
||||
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)
|
||||
|
||||
def get_queryset(self):
|
||||
|
|
Loading…
Reference in New Issue