38f92ed911f2797c1e89367af12be9965a2c0817
## 撤回:增删题单题目本来就会重算进度,我诊断错了
上一个 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>
OnlineJudge 2.0
An onlinejudge system based on Python and Vue. Demo
Overview
- Based on Docker; One-click deployment
- Separated backend and frontend; Modular programming; Micro service
- ACM/OI rule support; realtime/non-realtime rank support
- Amazing charting and visualization
- Template-problem support
- More reasonable permission control
- Multi-language support:
C,C++,Java,Python2,Python3 - Markdown & MathJax support
- Contest participants IP limit(CIDR)
Main modules are available below:
- Backend(Django): https://github.com/QingdaoU/OnlineJudge
- Frontend(Vue): https://github.com/QingdaoU/OnlineJudgeFE
- Judger Sandbox(Seccomp): https://github.com/QingdaoU/Judger
- JudgeServer(A wrapper for Judger): https://github.com/QingdaoU/JudgeServer
Installation
Follow me: https://github.com/QingdaoU/OnlineJudgeDeploy/tree/2.0
Documents
Screenshots
Frontend:
You can control the menu and chart status in rankings.
Admin:
Browser Support
Modern browsers(chrome, firefox) and Internet Explorer 10+.
Thanks
- I'd appreciate a star if you find this helpful.
- Thanks to everyone that contributes to this project.
- Special thanks to heb1c, who has given us a lot of suggestions.
License
Description












