mirror of https://github.com/jumpserver/jumpserver
perf: 优化 asset 创建时 nodes 可能有问题
parent
076a4333a1
commit
a1440ee4e0
|
@ -21,9 +21,7 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def default_node():
|
||||
from orgs.utils import current_org
|
||||
from ..node import Node
|
||||
return Node(id=current_org.id)
|
||||
return []
|
||||
|
||||
|
||||
class AssetManager(OrgManager):
|
||||
|
|
|
@ -227,6 +227,9 @@ class AssetSerializer(BulkOrgResourceModelSerializer, WritableNestedModelSeriali
|
|||
def validate_nodes(self, nodes):
|
||||
if nodes:
|
||||
return nodes
|
||||
nodes_display = self.initial_data.get('nodes_display')
|
||||
if nodes_display:
|
||||
return nodes
|
||||
request = self.context.get('request')
|
||||
if not request:
|
||||
return []
|
||||
|
|
Loading…
Reference in New Issue