优化视频复刻和商品内容大小
This commit is contained in:
@@ -413,11 +413,13 @@ class AssetViewSet(TeamScopedViewSetMixin, ModelViewSet):
|
||||
product_ids.update(str(x) for x in pid3 if x)
|
||||
if not product_ids:
|
||||
return []
|
||||
# 团队隔离(即便某 product_id 越权也过滤掉);只取 id/title
|
||||
rows = Product.objects.filter(team=self.get_team(), id__in=product_ids).values("id", "title")
|
||||
products = [{"id": str(r["id"]), "title": r["title"]} for r in rows]
|
||||
products.sort(key=lambda x: x["title"] or "")
|
||||
return products
|
||||
# 团队隔离(即便某 product_id 越权也过滤掉);只取 id/title,最新添加的在前
|
||||
rows = (
|
||||
Product.objects.filter(team=self.get_team(), id__in=product_ids)
|
||||
.order_by("-created_at")
|
||||
.values("id", "title")
|
||||
)
|
||||
return [{"id": str(r["id"]), "title": r["title"]} for r in rows]
|
||||
|
||||
@action(detail=True, methods=["get"], url_path="raw")
|
||||
def raw(self, request, pk=None):
|
||||
|
||||
Reference in New Issue
Block a user