Browse Source

fix: 修复全局组织批量删除资产500

pull/8746/head
feng626 2 years ago committed by Jiangjie.Bai
parent
commit
ddf4b61c9f
  1. 3
      apps/orgs/mixins/models.py

3
apps/orgs/mixins/models.py

@ -40,12 +40,11 @@ class OrgManager(models.Manager):
set_current_org(org)
return self
def bulk_create(self, objs, batch_size=None, ignore_conflicts=False):
org = get_current_org()
for obj in objs:
if org.is_root():
if not self.org_id:
if not obj.org_id:
raise ValidationError('Please save in a organization')
else:
obj.org_id = org.id

Loading…
Cancel
Save