解决已发现问题

This commit is contained in:
Azmat@qq.com
2026-09-17 15:00:15 +08:00
parent f3c49b36be
commit 5df038c635
24 changed files with 1913 additions and 94 deletions
+12 -1
View File
@@ -3,7 +3,7 @@
import logging
from decimal import Decimal, ROUND_HALF_UP
from django.db.models import Count, F, Q
from django.db.models import Case, CharField, Count, F, Q, Value, When
from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.decorators import api_view, permission_classes
@@ -469,6 +469,14 @@ def admin_tasks(request):
qs = (
AITask.objects.select_related("team", "model_config")
.defer("request_payload", "response_payload", "error_message")
# task_type 仍用于调度;用请求来源区分「全能创作」和自由视频/图片,不读取整份 Prompt。
.annotate(
task_category=Case(
When(request_payload__feature="omni_create", then=Value("omni_create")),
default=Value("standard"),
output_field=CharField(),
)
)
.order_by("-created_at")
)
st = request.query_params.get("status")
@@ -479,6 +487,9 @@ def admin_tasks(request):
tt = request.query_params.get("task_type")
if tt in dict(AITask.Type.choices):
qs = qs.filter(task_type=tt)
category = request.query_params.get("category")
if category == "omni_create":
qs = qs.filter(request_payload__feature="omni_create")
team_id = request.query_params.get("team")
if team_id:
qs = qs.filter(team_id=team_id)