Fix: V02-unsafe-get-mutations-verify - #994
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c350e6d65b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| </a> | ||
| <ul class="collapse submenu list-unstyled" id="dashboard2" data-parent="#accordionExample"> | ||
| {% for oname in request.session.Incharge %} | ||
| {% for account in request.session.InchargeAccounts %} |
There was a problem hiding this comment.
Preserve switches for existing account sessions
For sessions created before this deployment, update_related_account_in_session() stored only Incharge and NP, so InchargeAccounts is absent. This loop therefore renders no organization forms—despite the surrounding menu still being enabled by Incharge—and logged-in personal users lose account switching until they sign out and back in. Populate the new session field lazily or retain a compatible fallback for existing sessions.
AGENTS.md reference: AGENTS.md:L343-L345
Useful? React with 👍 / 👎.
V02 修复说明
已修复 GET/HEAD 触发身份切换、活动签到和通知批量变更的问题:
readall/deleteall已改为 CSRF POST,更新范围严格限定为当前接收者及合法源状态;单条通知 AJAX 操作也已补充 CSRF。验证结果:
manage.py check、迁移检查、Python 编译检查及git diff --check均通过兼容性说明:旧版签到二维码仍可导航至带校验值的确认页面,但 GET/HEAD 已无业务副作用,页面设置了
no-store和no-referrer,真正签到只会在用户确认后的 CSRF POST 中发生。