|
|
085110544d
|
chore: 再清 6 处零引用的函数/类(-47 行)
utils/tasks.py 整个文件(delete_files)
utils/async_helpers.py async_cache_delete
problem/utils.py build_problem_template
utils/shortcuts.py build_query_string
achievement/checker.py get_or_create_stat
problem/serializers.py TemplateSerializer
delete_files 的唯一调用者是上一个 commit 删掉的 DownloadContestSubmissions
(`delete_files.send_with_options(args=(zip_path,), delay=300_000)`,生成 zip 后
延时清理)。django_dramatiq 按约定自动发现各 app 的 tasks.py,缺一个文件不报错,
已实跑确认 judge / achievement / flowchart 三处的 actor 都还在。
## 扫出来但**不能删**的,记在这里免得下次又查一遍
**achievement/metrics.py 的 18 个指标类**:静态扫描报"零引用",因为类名确实
从不被引用 —— 它们靠 `@metric(key, name)` 装饰器在**定义时**注册进
METRIC_REGISTRY。删掉会静默丢掉成就维度,而且不报错。运行时确认注册表里
18 个一个不少。
**async_cache_get / async_cache_set**:各 6 处引用,只有 delete 那个是死的。
**parse_problem_template**:5 处引用,和被删的 build_problem_template 只是名字像。
**User 模型上的 open_api / open_api_appkey / two_factor_auth / session_keys**:
删字段要迁移,会改生产库结构 —— 而新后端正是靠"库结构与旧后端逐列一致"才能
回滚(阶段 5 演练验证过)。切换完成之前不动。
## 验证
manage.py check 通过;起本地 Django + PostgreSQL 实跑 14 个端点全部 200
(前台 10 个 + 后台 4 个);ruff 全绿;行尾未被改动。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
2026-08-08 07:23:42 -06:00 |
|
|
|
38f92ed911
|
chore: 删 11 个无引用序列化器;撤回一处误判的"修复"
## 撤回:增删题单题目本来就会重算进度,我诊断错了
上一个 commit 我给 ProblemSetProblemAdminAPI 的 post/delete 加了显式的
sync_all_progress_for_problemset,理由是"增删题目不重算进度"。**那是错的。**
problemset/signals.py 里有 post_save / post_delete 信号接收器,
在 ProblemSetProblem 变化时同步进度**并重算奖章**,且 apps.py 的 ready()
确实导入了 signals。我的显式调用只是让同一件事做两遍。
更该记住的是**为什么当时没发现**:那一版测试只看"进度有没有更新",
而信号和我的调用都会让它更新 —— 分不出是谁干的,所以照样是绿的。
这次的测试改成先撤掉调用再验,并直接断言信号已注册在 post_save/post_delete 上,
这样才真的有区分力。6/6 通过。
同一批修复里的另外 5 条经复核都成立,保留。特别是「移除用户留下孤儿奖章」——
signals.py 里**没有**针对 ProblemSetProgress 的 post_delete,那条必须自己清。
## 删无引用序列化器(-78 行)
全仓 106 个序列化器,11 个无任何引用:
account: FileUploadForm, GenerateUserSerializer, SSOSerializer,
UserChangeEmailSerializer, UserChangePasswordSerializer,
UsernameOrEmailCheckSerializer
contest: CreateContestAnnouncementSerializer, EditContestAnnouncementSerializer
problem: CreateProblemCodeTemplateSerializer
flowchart: FlowchartSubmissionMergedSerializer, FlowchartSubmissionSummarySerializer
前 8 个是上一个 commit 删掉的视图留下的(FileUploadForm 正是
SimditorFileUploadAPIView 用的),后 3 个是原本就死的。
检测器同样做了自检:拿 3 个明确在用的序列化器反测,没有误判。
另外确认这 11 个都没有字符串形式的动态引用。
`ruff check .` 全绿。行尾未被改动(上一轮踩过这个坑,这次脚本里加了断言)。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
2026-08-08 07:19:02 -06:00 |
|
|
|
5b393a3b4c
|
feat(problem): 新增批量给题目添加/移除标签接口
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2026-08-05 04:21:08 -06:00 |
|
|
|
c775ae4b22
|
feat(problem): 新增标签管理接口
列表带题目数,重命名撞名时自动合并并返回受影响题数,删除后清标签缓存。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2026-08-05 04:18:41 -06:00 |
|
|
|
9535b64a4b
|
精简 Problem 模型:移除 rule_type / total_score / io_mode
系统只用 ACM 模式且题目固定标准 IO,这三列已无实际用途:
- rule_type / total_score:OI 专用,删除后 judge/dispatcher 的 OI 分支全部塌缩为 ACM
- io_mode:判题改为固定发送 Standard IO 常量;languages.py 的 seccomp_rule
保留 dict 形态但改用字面量 key,不改判题机 wire 契约
- prompt 字段保留(预留给未来 AI 分析)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-07-04 11:40:38 -06:00 |
|
|
|
803d6ca58d
|
feat: SQL 题测试点预览接口
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-03 19:25:47 -06:00 |
|
|
|
5af9d67fe2
|
fix: 终审修复——test_case_id 格式校验、modify 空变更报错、异常兜底与文档补充
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-03 06:26:00 -06:00 |
|
|
|
06642b8131
|
feat: 保存 SQL 题时自动生成 sql_display 展示数据
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-03 01:15:58 -06:00 |
|
|
|
9f7f818d51
|
新增 SQL 题型:SQLite 内联判题(不依赖外部沙箱)
- SQL 作为语言接入现有提交流程,judge_task 按 language 分流到 SQLJudgeDispatcher
- judge/sql_runner.py:内存 SQLite 判题核心,查询题比结果集/增删改题比表状态,
authorizer + progress_handler + max_page_count 三重防护
- dispatcher 提取 _process_judge_result/_push_status 供 SQL 判题复用(行为不变)
- 测试点通道支持 1.sql..N.sql 压缩包,出题只需数据脚本+标准答案
- Problem 增加 sql_config 字段;options 数据迁移注册 SQL 语言
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-02 17:23:13 -06:00 |
|
|
|
1217ee3eaf
|
update
|
2026-05-26 02:19:26 -06:00 |
|
|
|
bf2a95ef01
|
update
|
2026-05-25 23:55:19 -06:00 |
|
|
|
2e7c6fb404
|
update
|
2026-05-25 21:56:11 -06:00 |
|
|
|
c36e6623bd
|
feat: add AST_CHECK_FAILED status, is_accepted helper, ast_rules field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-05-25 20:37:58 -06:00 |
|
|
|
8a0bfb6b24
|
update
|
2026-05-21 19:52:37 -06:00 |
|
|
|
c466dfd3c6
|
change enum
|
2026-05-09 02:30:47 -06:00 |
|
|
|
028ea6e5f9
|
fmt
|
2026-04-23 13:57:56 -06:00 |
|
|
|
c4ddfa6841
|
add flowchart
|
2026-04-12 06:00:39 -06:00 |
|
|
|
32a608476d
|
update
|
2025-10-23 00:54:06 +08:00 |
|
|
|
bfd79720a9
|
fix
|
2025-10-13 12:27:21 +08:00 |
|
|
|
d3484c57bf
|
fix
|
2025-10-12 12:18:03 +08:00 |
|
|
|
dbbe38381a
|
fix
|
2025-10-12 12:12:52 +08:00 |
|
|
|
d7e0046a6a
|
fix
|
2025-10-12 00:03:27 +08:00 |
|
|
|
4168d41a16
|
删除无用代码并且新增流程图相关内容
|
2025-10-11 23:29:56 +08:00 |
|
|
|
1594098908
|
fix
|
2025-10-04 01:25:04 +08:00 |
|
|
|
60a100ab60
|
add problem answers
|
2025-10-04 00:57:12 +08:00 |
|
|
|
43f0b7818f
|
add problem prompt
|
2025-10-04 00:32:25 +08:00 |
|
|
|
a5fc7cc369
|
隐藏评论
|
2025-06-15 17:48:51 +08:00 |
|
yuetsh
|
4003e74166
|
fix
|
2024-06-12 10:27:34 +08:00 |
|
yuetsh
|
8a47c6e0ef
|
update announcement and problem list serializer
|
2024-06-12 10:05:26 +08:00 |
|
|
|
7a152d65a3
|
get what i want
|
2024-05-07 20:25:59 +08:00 |
|
virusdefender
|
f2576a9411
|
fix tests
|
2019-03-26 10:51:49 +08:00 |
|
virusdefender
|
8cdc4acaaf
|
share submission
|
2019-03-13 17:57:41 +08:00 |
|
virusdefender
|
d969c6fe5e
|
后端增加题目 io mode 相关逻辑
|
2019-03-12 16:38:40 +08:00 |
|
virusdefender
|
a52f383930
|
将编译选项修改为数据库存储
|
2019-01-05 14:12:17 +08:00 |
|
virusdefender
|
2dc1d0cbce
|
修复 ACM 类型题目导入后,无法显示测试用例信息的问题
|
2019-01-05 14:12:17 +08:00 |
|
creedowl
|
c6f728b58c
|
fix missing output_name when import/export porblem
|
2018-08-16 13:24:44 +08:00 |
|
virusdefender
|
08ea52afa9
|
去除部分提交限制
|
2018-05-17 01:22:18 +08:00 |
|
virusdefender
|
82890a92b4
|
support fps problems import; fix qduoj problems import
|
2018-04-18 00:08:18 +08:00 |
|
virusdefender
|
9a3f21461a
|
修复某些情况下泄露template的问题
|
2017-12-19 22:15:38 +08:00 |
|
zema1
|
0f9f34df65
|
支持选取已有题目作为比赛题目
|
2017-12-03 18:52:32 +08:00 |
|
zema1
|
ee89df9ff2
|
去除不必要的serializer
|
2017-12-01 17:19:31 +08:00 |
|
virusdefender
|
945ea5e4e0
|
parse problem code template
|
2017-11-26 14:04:38 +08:00 |
|
zema1
|
e8b06f0487
|
add generate user api
|
2017-11-18 08:26:41 +08:00 |
|
zema1
|
334b67488a
|
添加SPJ编译API
|
2017-11-16 22:12:17 +08:00 |
|
zema1
|
ffd5943492
|
修复sample空格被吃掉的问题;
修复test_id 不对应的问题
|
2017-11-13 21:29:27 +08:00 |
|
zema1
|
2d00ed802d
|
添加initinstall命令
|
2017-11-07 19:04:41 +08:00 |
|
zema1
|
70f52b6f27
|
用户名不区分大小写;
修复更新problem时的一些问题
|
2017-11-02 15:29:08 +08:00 |
|
zema1
|
aa4240790b
|
fix many bugs
|
2017-10-31 16:33:25 +08:00 |
|
zema1
|
728373a5ff
|
完善contest权限控制
|
2017-10-27 18:36:29 +08:00 |
|
zema1
|
f5566148bc
|
完善OI细则
|
2017-10-16 09:45:55 +08:00 |
|