Commit Graph

79 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
c466dfd3c6 change enum 2026-05-09 02:30:47 -06:00
028ea6e5f9 fmt 2026-04-23 13:57:56 -06:00
893b2aba79 fix 2025-09-25 19:23:12 +08:00
e49cba4a51 fix 2025-09-25 18:42:20 +08:00
a6d76a64c4 重构用户权限 2025-09-25 18:41:23 +08:00
24f1a0372e 提交题目完成的排名 2025-09-21 19:11:18 +08:00
74337ca10d 保存明文密码 2025-05-09 22:42:01 +08:00
09e693bf25 后台可以筛选管理员 2025-04-30 09:51:19 +08:00
yuetsh
fa8c7cf422 update 2024-06-19 12:05:35 +08:00
LiYang
856c3e52b6 fix xss 2021-08-02 12:48:26 +08:00
virusdefender
c192304fd8 增加文件上传功能 2019-03-12 14:54:07 +08:00
zema1
93cb2bc3fe Added: language profile 2018-07-15 12:43:44 +08:00
virusdefender
e843404c5f sso api 2018-05-06 01:06:49 +08:00
virusdefender
0e1d40792f update release note
update sentry settings
2018-01-04 20:47:57 +08:00
zema1
10ecb79152 fix admin update user real_name problem 2017-12-10 10:05:12 +08:00
zema1
ee89df9ff2 去除不必要的serializer 2017-12-01 17:19:31 +08:00
zema1
5429e99465 调整UserSerializer 2017-11-30 20:17:56 +08:00
virusdefender
2d038c7bcc use bulk_create and transaction for user generator 2017-11-24 23:53:47 +08:00
zema1
2b4fb4f368 import users api 2017-11-22 20:06:16 +08:00
zema1
e8b06f0487 add generate user api 2017-11-18 08:26:41 +08:00
zema1
37d6dd84ee 修复contest announcement的一些问题 2017-11-06 19:05:21 +08:00
zema1
b86ebf0ed7 题目AC后不计入AC计数器;
支持图片上传
2017-11-01 23:07:37 +08:00
zema1
728373a5ff 完善contest权限控制 2017-10-27 18:36:29 +08:00
virusdefender
93bd77d8d8 bug fixes 2017-10-09 18:55:25 +08:00
virusdefender
a324d55364 tiny work 2017-10-02 05:16:14 +08:00
zema1
e9c7344815 adjust account fields, cache the website_config 2017-09-22 16:41:29 +08:00
zema1
034ad59f2e support avatar upload;
use middleware to operate session data.
2017-09-19 19:10:50 +08:00
zema1
f55a242ec0 Move real_name to UserProfile;
Delete student_id field;
Mark the problems that have submission;
Alter dispatcher to adapt the changes.
2017-09-12 11:45:17 +08:00
zemal
07643e2639 ranklist相关的改动 2017-08-20 20:32:07 +08:00
zemal
3b1f02c356 整理代码 2017-08-20 08:35:59 +08:00
zemal
0647312124 add username or email check api 2017-08-19 17:25:39 +08:00
zemal
b931724c9b 修改用户信息api 2017-07-04 10:26:02 +08:00
Chiaki
043f8c8b26 Change account interface 2017-04-30 21:58:34 +08:00
Chiaki
ee05af8e5a Add sso and 2fa api 2017-04-18 15:19:26 +08:00
Chiaki
a9b25b872a for pass ci... 2017-04-18 12:05:07 +08:00
Chiaki
e3692c2329 Add reset password api 2017-04-18 11:57:57 +08:00
virusdefender
817e5aadae rename some method and add some decorator 2017-02-10 11:46:23 +08:00
virusdefender
802f27a516 add user problem permission 2017-02-10 10:38:32 +08:00
virusdefender
5b7aacc6ac allow empty password 2017-01-26 17:06:24 +08:00
virusdefender
d9fad97e35 isort 2017-01-23 16:48:04 +08:00
virusdefender
c26ee6e87a remove unused coding=utf-8 2017-01-23 16:31:17 +08:00
virusdefender
172fd4b1f4 使用Python3和更科学的API写法 2016-11-19 12:32:23 +08:00
virusdefender
39857d1b56 add some tests 2016-10-30 02:17:35 +08:00
virusdefender
61ab910d53 重构 2016-09-25 14:07:45 +08:00
virusdefender
eb02a00859 修改账户系统以及部分用户权限写法
增加部分测试和注释,完善国际化
2016-06-23 12:19:16 +08:00
virusdefender
4737e970f5 个人信息中的学校改为选填 2016-05-13 12:12:50 +08:00
spxcds
485462d702 修复用户禁用功能的部分bug 2016-03-27 18:29:58 +08:00
spxcds
7a841214d4 增加禁用用户的功能 2016-03-27 01:26:24 +08:00