[Update]优化资产设置节点的问题 (#2786)

* [Update]优化资产设置节点的问题

* [Update]优化资产创建的节点设置
pull/2790/head
八千流 6 years ago committed by BaiJiangJie
parent 3e86c07411
commit 69b91df96b

@ -51,10 +51,12 @@ class AssetViewSet(IDInCacheFilterMixin, LabelFilter, BulkModelViewSet):
def set_assets_node(self, assets):
if not isinstance(assets, list):
assets = [assets]
node = Node.root()
node_id = self.request.query_params.get('node_id')
if node_id:
if not node_id:
return
node = get_object_or_none(Node, pk=node_id)
if not node:
return
node.assets.add(*assets)
def perform_create(self, serializer):

Loading…
Cancel
Save