Backport the invitee-only invitation accept and decline check (#5893) to hotfixes

未关闭
#6,406 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
1/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
django, python

调研方向

Read the hotfixes versions of InvitationViewSet.accept and decline in contentcuration/contentcuration/viewsets/invitation.py, then compare them with the fix from #5893 on unstable. Use contentcuration/contentcuration/tests/viewsets/test_invitation.py to check the expected behavior for invitees and other channel users. Done when the tests from #5893 pass on hotfixes and unauthorized attempts leave the invitation unchanged.

由索引模型根据 Issue 内容生成。

描述

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

#5893 restricted the invitation accept and decline actions to the invited user, fixing #5781, but it merged to unstable only. On hotfixes, the sender, editors and viewers of the channel can still accept or decline an invitation on the invitee's behalf. Accepting adds the invitee to the channel without their agreement.

Complexity: Low
Target branch: hotfixes

Context
  • On hotfixes, InvitationViewSet.accept and decline load the invitation with get_object(). Its queryset is Invitation.filter_view_queryset, which includes invitations the user sent and invitations to channels the user edits or views.
  • The fix is learningequality/studio@073735535 on unstable, with its tests in contentcuration/contentcuration/tests/viewsets/test_invitation.py.
The Change
  • The invitee-only check from #5893 should apply on hotfixes.
Acceptance Criteria
General
  • On hotfixes, a channel editor, channel viewer or sender who isn't the invitee gets the same response from accept and decline as they do on unstable after #5893, and the invitation is unchanged.
  • The invitee can still accept and decline.
Testing
  • The tests added in #5893 pass on hotfixes.

AI usage

I decided this needs a backport. Claude Code found that #5893 isn't on hotfixes and drafted this issue.

主要语言
Python
星标
212
派生
321
平均合并
1 天 7 小时
30 天内合并 PR
14

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

learningequality/studio 的其他 Issue

查看 learningequality/studio 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。