From 03d9570895433258f9c6cd78f5dda809da131c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AB=E5=8D=83=E6=B5=81?= <40739051+jym503558564@users.noreply.github.com> Date: Tue, 11 Jun 2019 10:09:40 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?API,=E5=88=9B=E5=BB=BA=E7=94=A8=E6=88=B7=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=85=B3=E7=B3=BB=20(#2776)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/api/user.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/users/api/user.py b/apps/users/api/user.py index c7668cb8..11681977 100644 --- a/apps/users/api/user.py +++ b/apps/users/api/user.py @@ -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): -- 2.18.0