mirror of https://github.com/jumpserver/jumpserver
Merge pull request #3809 from jumpserver/dev_bai
[Update] 修改Node generate fake时死循环的问题pull/3811/head
commit
cff3a790ef
|
@ -574,8 +574,6 @@ class Node(OrgModelMixin, SomeNodesMixin, TreeMixin, FamilyMixin, FullValueMixin
|
||||||
org = get_current_org()
|
org = get_current_org()
|
||||||
if not org or not org.is_real():
|
if not org or not org.is_real():
|
||||||
Organization.default().change_to()
|
Organization.default().change_to()
|
||||||
i = 0
|
|
||||||
while i < count:
|
|
||||||
nodes = list(cls.objects.all())
|
nodes = list(cls.objects.all())
|
||||||
if count > 100:
|
if count > 100:
|
||||||
length = 100
|
length = 100
|
||||||
|
@ -584,4 +582,5 @@ class Node(OrgModelMixin, SomeNodesMixin, TreeMixin, FamilyMixin, FullValueMixin
|
||||||
|
|
||||||
for i in range(length):
|
for i in range(length):
|
||||||
node = random.choice(nodes)
|
node = random.choice(nodes)
|
||||||
node.create_child('Node {}'.format(i))
|
child = node.create_child('Node {}'.format(i))
|
||||||
|
print("{}. {}".format(i, child))
|
||||||
|
|
Loading…
Reference in New Issue