mirror of https://github.com/jumpserver/jumpserver
fix: 修复全局组织批量删除资产500
parent
0eaaa7b4f6
commit
ddf4b61c9f
|
@ -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…
Reference in New Issue