mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修改创建第一个节点的Bug
parent
ccc292d9a9
commit
3a4c7846bf
|
@ -185,7 +185,7 @@ class Node(OrgModelMixin):
|
|||
else:
|
||||
set_current_org(Organization.root())
|
||||
org_nodes_roots = cls.objects.filter(key__regex=r'^[0-9]+$')
|
||||
org_nodes_roots_keys = org_nodes_roots.values_list('key', flat=True)
|
||||
org_nodes_roots_keys = org_nodes_roots.values_list('key', flat=True) or [0]
|
||||
key = max([int(k) for k in org_nodes_roots_keys]) + 1
|
||||
set_current_org(_current_org)
|
||||
root = cls.objects.create(key=key, value=_current_org.name)
|
||||
|
|
Loading…
Reference in New Issue