Commit Graph

23 Commits

Author SHA1 Message Date
625f2466e5 refactor: 统一用户名的 ks 班级前缀处理
同一个剥前缀函数在 submission 和 flowchart 的管理端各有一份逐字相同的
拷贝,conf 里还有一份内联写法,合并到 utils/shortcuts.strip_class_prefix。

改名是因为原名 get_real_name 和 UserProfile.real_name 字段、以及三个
serializer 里的同名方法都容易混。

行为上修了两处:

- 剥前缀改用 removeprefix,不再按长度硬切。班级号对不上时原样返回,
  旧写法会从中间截出乱码(ks999王五 配 class_name=251 会切成「王五」)
- get_class_name 的正则从 \d+ 收紧到 \d{3,4},与前端
  ButtonWithSearch 的 /^ks\d{3,4}/ 对齐。旧的贪婪匹配在姓名部分是纯
  数字时会吃掉整串(ks251001 返回 251001 而不是 251)。顺带 re.search
  换成 re.match,外层的 startswith 判断并进正则

正常数据(ks251张三、ks2510李四)新旧结果一致,已逐例对拍。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 23:58:13 -06:00
3a9ab83ba5 style: ruff format 全仓库
行宽 180 下把历史遗留的折行表达式合并,无语义改动。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-05 04:45:26 -06:00
d1fdbcf52b fix 2026-06-02 23:13:06 -06:00
980b803517 feat: update all query filters to treat AST_CHECK_FAILED as accepted
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 20:45:15 -06:00
2cd1e2701f fix 2026-05-24 23:43:18 -06:00
c1d2e960bd add all in duration 2026-05-24 23:11:53 -06:00
65c48437a9 fix 2026-05-24 20:44:02 -06:00
028ea6e5f9 fmt 2026-04-23 13:57:56 -06:00
ea92a24f82 返回提交id 2026-01-04 10:32:02 +08:00
6e1e3ef0c6 新增AI分析 2025-09-24 01:02:29 +08:00
43dfeb2fa0 击败多少用户 2025-04-13 21:48:35 +08:00
6522b70cd3 fix 2024-10-16 20:45:20 +08:00
ed16e2b6b1 fix 2024-10-16 20:15:09 +08:00
78a247acd5 统计数据添加没完成的人 2024-10-16 18:27:07 +08:00
yuetsh
0e8e7bbed8 add person statistics 2024-06-04 18:49:25 +08:00
yuetsh
a2f0ce334e groupby username 2024-06-04 09:15:37 +08:00
8890f520eb add submission statistics 2024-06-03 23:14:10 +08:00
virusdefender
a5f0c8eb31 remove celery and use dramatiq 2019-03-11 17:59:24 +08:00
zema1
992192e479 fix rejudge function 2018-11-26 11:25:16 +08:00
virusdefender
2e50910931 add migration to correct database record; rejudge function now can work normally. 2018-03-27 16:22:25 +08:00
virusdefender
a0da0b5fa6 修复了 submission_number 不变的问题 2018-03-27 13:32:43 +08:00
zema1
a1eed315b4 支持非比赛submission的重判 2017-11-24 10:27:34 +08:00
Chiaki
65f9c7f52b Add submission module 2017-05-08 17:29:01 +08:00