mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-18 00:08:31 +00:00
chore: 添加注释
This commit is contained in:
@@ -49,6 +49,9 @@ class OrgModelMixin(models.Model):
|
|||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
org = get_current_org()
|
org = get_current_org()
|
||||||
|
# 这里不可以优化成, 因为 root 组织下可以设置组织 id 来保存
|
||||||
|
# if org.is_root() and not self.org_id:
|
||||||
|
# raise ...
|
||||||
if org.is_root():
|
if org.is_root():
|
||||||
if not self.org_id:
|
if not self.org_id:
|
||||||
raise ValidationError('Please save in a organization')
|
raise ValidationError('Please save in a organization')
|
||||||
|
Reference in New Issue
Block a user