From 0c96bf61efac66382908dbb4ce53c7b792aac5d3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 4 Aug 2021 11:00:11 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/orgs/mixins/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/orgs/mixins/models.py b/apps/orgs/mixins/models.py index 66edc37e0..498d90a5a 100644 --- a/apps/orgs/mixins/models.py +++ b/apps/orgs/mixins/models.py @@ -49,6 +49,9 @@ class OrgModelMixin(models.Model): def save(self, *args, **kwargs): org = get_current_org() + # 这里不可以优化成, 因为 root 组织下可以设置组织 id 来保存 + # if org.is_root() and not self.org_id: + # raise ... if org.is_root(): if not self.org_id: raise ValidationError('Please save in a organization')