perf: 优化 asset 创建时 nodes 可能有问题

pull/9622/head
ibuler 2 years ago
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…
Cancel
Save