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

pull/8746/head
feng626 2 years ago committed by Jiangjie.Bai
parent 0eaaa7b4f6
commit ddf4b61c9f

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

Loading…
Cancel
Save