|
|
e42cfac3ce
|
feat: 班级号位数不合法直接报错,规则收敛到一处
原先班级号位数不对是静默处理的:get_class_name 猜前几位,class_list
根本不校验,填错只表现为登录页班级下拉查不到人。现在两个入口都报错。
- get_class_name 先用 \d+ 抓全再判位数,不合法抛 APIError。不能直接用
CLASS_NAME_RE 匹配,那样 ks251001 会"匹配成功"并悄悄取前 4 位,正是
要避免的猜测
- CreateEditWebsiteConfigSerializer 加 validate_class_list
- 位数规则收敛到 utils/shortcuts 的 CLASS_NAME_MIN/MAX_DIGITS 和
is_valid_class_name,两个调用方和错误文案都从常量拼
不以 ks+数字 开头的用户名(管理员、教师账号、kstest)仍返回 None 不报错,
只校验"看起来想当班级用户名"的。
批量导入的构造循环在 transaction.atomic() 之前,报错时一条都不入库。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
2026-08-06 00:15:47 -06:00 |
|
|
|
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 |
|
|
|
3a9ab83ba5
|
style: ruff format 全仓库
行宽 180 下把历史遗留的折行表达式合并,无语义改动。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2026-08-05 04:45:26 -06:00 |
|
|
|
0f3f2d256f
|
实时修改设置
|
2025-10-11 13:30:54 +08:00 |
|
|
|
9a90b82364
|
fix
|
2024-11-15 22:03:19 +08:00 |
|
virusdefender
|
fea77ce92b
|
smtp账户不一定是邮箱
|
2018-05-17 01:22:05 +08:00 |
|
virusdefender
|
03cf356bab
|
add judge server is_disabled field
|
2017-12-24 14:49:23 +08:00 |
|
virusdefender
|
290be9f8bc
|
service url now is required
|
2017-12-24 12:08:56 +08:00 |
|
zema1
|
ee89df9ff2
|
去除不必要的serializer
|
2017-12-01 17:19:31 +08:00 |
|
virusdefender
|
a324d55364
|
tiny work
|
2017-10-02 05:16:14 +08:00 |
|
virusdefender
|
9990cf647a
|
使用 SysOptions
|
2017-10-02 03:54:34 +08:00 |
|
virusdefender
|
0fe5b10418
|
add judge server status field
|
2017-01-24 13:22:12 +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
|
294fd8b5b2
|
rename website_footer ->footer
|
2016-11-19 17:19:04 +08:00 |
|
virusdefender
|
637baba71b
|
add conf app and related test and settings
|
2016-11-19 13:47:59 +08:00 |
|