Commit Graph

16 Commits

Author SHA1 Message Date
927f235537 refactor: 移除邮件功能
发信能力整体下线,唯一的调用方(忘记密码)前端也从来没接过。

- utils/shortcuts.py 删 send_email,连带四个 django.core.mail 相关 import
- account/tasks.py 整个删除,里面只有 send_email_async 一个 actor
- 删 ApplyResetPasswordAPI / ResetPasswordAPI 及其路由、serializer,
  User.reset_password_token 和 reset_password_token_expire_time 两个
  字段(account/0010)
- 删 SMTPAPI / SMTPTestAPI 及其路由、三个 SMTP serializer、
  SysOptions.smtp_config
- account/templates/reset_password_email.html

options/0003 数据迁移删掉库里的 smtp_config 行:_init_option 会为每个
OptionKey 建行,key 从代码里去掉后它会变成孤儿,而且配过 SMTP 的话
value 里存着明文密码。

保留 ResetUserPasswordAPI(管理端直接重置密码,不发信,前端在用)和
User.email(注册要填)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 23:17:48 -06:00
989b33d827 refactor: 移除 2FA 功能与三个冗余依赖
2FA 早已是死代码:TOTP 相关端点标注为前端未调用,前端唯一的
two_factor_auth 是硬编码 false,没有任何入口能打开它。

- 删除 TwoFactorAuthAPI、CheckTFARequiredAPI、_totp* 辅助函数、
  TwoFactorAuthCodeSerializer 及各 serializer 的 tfa_code 字段
- 删除管理端写 two_factor_auth/tfa_token 的分支。登录已不再校验
  TOTP,若保留写入路径,置 True 会变成静默的安全降级
- 删除 User.two_factor_auth / tfa_token 字段(迁移 0009)
- 移除 django-dbconn-retry:仅挂在 INSTALLED_APPS,代码零引用。
  DATABASES 未配置 CONN_MAX_AGE(默认 0),本就没有持久连接需要
  重连修复。要开持久连接用 Django 自带的 CONN_HEALTH_CHECKS
- requests 换成 httpx(openai 已经引入):删除废弃的
  ReleaseNotesAPI,judge dispatcher 显式传 timeout=None 以保持
  requests 原本的无超时行为,判题请求是同步等结果的

依赖净减 5 个:otpauth、qrcode、requests、charset-normalizer、
django-dbconn-retry

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 23:00:45 -06:00
57c0572fd9 async 2026-05-26 21:25:26 -06:00
028ea6e5f9 fmt 2026-04-23 13:57:56 -06:00
8ed6b319c5 班级抽签 2025-04-14 14:19:26 +08:00
yuetsh
c497d511dc refactor 2024-07-01 12:17:43 +08:00
6cf7087339 update Django to v5 2024-06-05 17:40:45 +08:00
zema1
b388c5dd03 add dashboard api 2018-01-04 19:43:18 +08:00
zema1
914c4727fc add new version api 2018-01-04 19:43:18 +08:00
virusdefender
872e7407cf add smtp test function 2017-12-24 11:34:40 +08:00
zema1
2cca83aebf test_case prune api
fix tests
2017-12-23 22:11:37 +08:00
Chiaki
3caf2d9d2c Allow multiple ways to access url and fix ci 2017-04-18 15:39:49 +08:00
virusdefender
d9fad97e35 isort 2017-01-23 16:48:04 +08:00
virusdefender
32c1b89080 flake8 2017-01-23 16:25:14 +08:00
virusdefender
f56d75cf91 add judge_server related api 2016-11-20 19:18:25 +08:00
virusdefender
637baba71b add conf app and related test and settings 2016-11-19 13:47:59 +08:00