fix: 修复flake8 lint检查错误
All checks were successful
continuous-integration/drone/push Build is passing

- 删除废弃的 admin_positions_backup.py 备份文件
- 修复 courses.py 缺失的 select 导入
- 修复 coze_gateway.py 异常变量作用域问题
- 修复 scheduler_service.py 无用的 global 声明
- 添加 TYPE_CHECKING 导入解决模型前向引用警告
This commit is contained in:
yuliang_guo
2026-01-31 17:43:39 +08:00
parent 18d6d5aff3
commit 41a2f7944a
6 changed files with 25 additions and 173 deletions

View File

@@ -2,10 +2,14 @@
成长路径相关数据库模型
"""
from enum import Enum
from typing import List, Optional
from typing import List, Optional, TYPE_CHECKING
from datetime import datetime
from decimal import Decimal
if TYPE_CHECKING:
from app.models.course import Course
from app.models.user import User
from sqlalchemy import (
String,
Text,
@@ -84,7 +88,7 @@ class GrowthPathNode(BaseModel, SoftDeleteMixin):
)
# 关联关系
growth_path: Mapped["GrowthPath"] = relationship(
growth_path: Mapped["GrowthPath"] = relationship( # noqa: F821
"GrowthPath", back_populates="nodes"
)
course: Mapped["Course"] = relationship("Course")
@@ -146,7 +150,7 @@ class UserGrowthPathProgress(BaseModel):
# 关联关系
user: Mapped["User"] = relationship("User")
growth_path: Mapped["GrowthPath"] = relationship("GrowthPath")
growth_path: Mapped["GrowthPath"] = relationship("GrowthPath") # noqa: F821
class UserNodeCompletion(BaseModel):
@@ -203,4 +207,4 @@ class UserNodeCompletion(BaseModel):
node: Mapped["GrowthPathNode"] = relationship(
"GrowthPathNode", back_populates="user_completions"
)
growth_path: Mapped["GrowthPath"] = relationship("GrowthPath")
growth_path: Mapped["GrowthPath"] = relationship("GrowthPath") # noqa: F821