fix: AuthenticatedUser.user_id 改为 user.id,修复编辑器500
AI Code Review / AI Code Review (pull_request) Successful in 2m22s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 2m39s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 3m6s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 6m35s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 7m36s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 24s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1372h10m15s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1372h10m34s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1372h10m34s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1372h10m38s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1372h10m38s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1372h42m48s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1372h42m42s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1372h42m46s
AI Code Review / AI Code Review (pull_request) Successful in 2m22s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 2m39s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 3m6s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 6m35s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 7m36s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 24s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1372h10m15s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1372h10m34s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1372h10m34s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1372h10m36s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1372h10m38s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1372h10m38s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1372h42m48s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1372h42m42s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1372h42m46s
AuthenticatedUser 类只有 user/session_id/token_type 字段,没有 user_id。 编辑器路由和 auth 路由中 13 处 current_user.user_id 全部写错, 导致首次访问编辑器时报 AttributeError 500。 修复为 current_user.user.id 正确访问方式。
This commit is contained in:
Executable → Regular
+1
-1
@@ -569,7 +569,7 @@ async def bind_contact(
|
||||
verification_code_service=vc_service,
|
||||
)
|
||||
uc_request = UseCaseRequest(
|
||||
user_id=current_user.user_id,
|
||||
user_id=current_user.user.id,
|
||||
phone=request.phone,
|
||||
phone_code=request.phone_code,
|
||||
email=request.email,
|
||||
|
||||
@@ -649,7 +649,7 @@ def get_draft_plan_id(
|
||||
tpl_svc, _ = services
|
||||
draft = tpl_svc.get_or_create_draft(
|
||||
template_id,
|
||||
user_id=str(current_user.user_id),
|
||||
user_id=str(current_user.user.id),
|
||||
)
|
||||
return draft.id
|
||||
|
||||
@@ -1084,7 +1084,7 @@ def update_editor_bgm(
|
||||
template_id,
|
||||
plan_id,
|
||||
current_bgm.get("enabled", False),
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return {
|
||||
@@ -1332,7 +1332,7 @@ def generate_editor_draft(
|
||||
clip_count = plan_svc.mark_clips_ready(plan_id)
|
||||
|
||||
gen_task_repo = SQLAlchemyGenerationTaskRepository(db)
|
||||
user_id = current_user.user_id
|
||||
user_id = current_user.user.id
|
||||
_check_queue_limits(gen_task_repo, user_id)
|
||||
|
||||
gen_task_use_case = CreateGenerationTaskUseCase(gen_task_repo)
|
||||
@@ -1342,7 +1342,7 @@ def generate_editor_draft(
|
||||
CreateGenerationTaskCommand(
|
||||
project_id=plan.project_id or "",
|
||||
template_id=plan.template_id,
|
||||
created_by_user_id=current_user.user_id,
|
||||
created_by_user_id=current_user.user.id,
|
||||
source_edit_plan_id=plan_id,
|
||||
asset_ids=list(config_asset_ids) if config_asset_ids else [],
|
||||
),
|
||||
@@ -1360,7 +1360,7 @@ def generate_editor_draft(
|
||||
plan_id,
|
||||
gen_task.id,
|
||||
clip_count,
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return EditPlanGenerateResponse(
|
||||
@@ -1891,7 +1891,7 @@ def editor_ai_recommend(
|
||||
plan_id,
|
||||
len(result["clips"]),
|
||||
result["total_duration"],
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return AIRecommendResponse(
|
||||
@@ -1946,7 +1946,7 @@ def editor_generate_cover(
|
||||
template_id,
|
||||
plan_id,
|
||||
body.cover_type,
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return GenerateCoverResponse(plan_id=plan_id, cover=cover_data)
|
||||
@@ -2362,7 +2362,7 @@ def extract_editor_cover(
|
||||
template_id,
|
||||
plan_id,
|
||||
body.clip_id,
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return CoverGenerateResponse(
|
||||
@@ -2404,7 +2404,7 @@ def smart_editor_cover(
|
||||
template_id,
|
||||
plan_id,
|
||||
body.strategy,
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return CoverGenerateResponse(
|
||||
@@ -2485,7 +2485,7 @@ def create_clips_from_assets_editor(
|
||||
template_id,
|
||||
plan_id,
|
||||
len(clips),
|
||||
current_user.user_id,
|
||||
current_user.user.id,
|
||||
)
|
||||
|
||||
return ClipsFromAssetsResponse(
|
||||
|
||||
Executable → Regular
+2
-2
@@ -113,7 +113,7 @@ def update_video_review_status(
|
||||
if item is None:
|
||||
raise HTTPException(status_code=404, detail="Video not found")
|
||||
logger.info(
|
||||
"Video %s review status updated to %s by user %s", video_id, request.review_status, current_user.user_id
|
||||
"Video %s review status updated to %s by user %s", video_id, request.review_status, current_user.user.id
|
||||
)
|
||||
return _to_video_response(item, storage)
|
||||
|
||||
@@ -197,7 +197,7 @@ def batch_download_videos(
|
||||
# 发送 celery 任务
|
||||
task = celery_app.send_task(
|
||||
"worker.batch_download_videos",
|
||||
args=[request.video_ids, current_user.user_id],
|
||||
args=[request.video_ids, current_user.user.id],
|
||||
)
|
||||
|
||||
logger.info("Batch download job created: %s, videos=%d", task.id, len(request.video_ids))
|
||||
|
||||
Reference in New Issue
Block a user