Commit Graph

34 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
69bd6af6ec update 2026-06-05 09:58:52 -06:00
d7e04adf07 fix 2026-06-05 09:46:49 -06:00
2b65acf91a update 2026-06-05 08:51:57 -06:00
745ddb56f9 fix 2026-06-03 07:38:07 -06:00
734f596e1a update 2026-06-03 07:29:03 -06:00
0764946c17 add wc 2026-06-03 07:19:57 -06:00
57c0572fd9 async 2026-05-26 21:25:26 -06:00
65c48437a9 fix 2026-05-24 20:44:02 -06:00
5371b7daf1 fix temperature 2026-05-24 20:34:17 -06:00
b297eb5475 update 2026-05-09 03:29:25 -06:00
cf856857df ai llm 2026-05-09 03:13:30 -06:00
c466dfd3c6 change enum 2026-05-09 02:30:47 -06:00
97a9269e2a fix 2026-05-09 01:38:24 -06:00
031be90445 fix 2026-05-08 20:16:19 -06:00
34f6a2e24a no thinking 2026-05-08 19:25:07 -06:00
df097dd610 fix flowchart 2026-05-07 06:09:13 -06:00
c0c5be9420 change to v4 flash 2026-04-27 06:32:06 -06:00
028ea6e5f9 fmt 2026-04-23 13:57:56 -06:00
94b618c2ac ai prompt 2026-04-11 02:15:06 -06:00
a12a665fde update 2026-03-18 13:26:32 +08:00
ed40019a14 自动生成流程图 2026-01-05 10:23:02 +08:00
3b0beb851f fix 2025-12-29 22:49:19 +08:00
905b84b858 fix 2025-12-29 22:41:56 +08:00
9d1141bdd6 fix 2025-12-29 22:36:01 +08:00
3cf03fc286 add endpoint for flowchart's detail 2025-12-29 22:24:15 +08:00
a103dd6b38 add flowchart list 2025-10-20 20:05:10 +08:00
a02acf76b8 update 2025-10-14 09:25:36 +08:00
52aca0fd8c update 2025-10-14 01:17:59 +08:00
04dcba9091 update 2025-10-14 00:24:05 +08:00
2c8f74b1b6 update 2025-10-13 23:40:26 +08:00
bfd79720a9 fix 2025-10-13 12:27:21 +08:00
4168d41a16 删除无用代码并且新增流程图相关内容 2025-10-11 23:29:56 +08:00