Accepting an invitation gives the role to a user record looked up by email
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
Đọc Invitation.accept trong contentcuration/contentcuration/models.py, khoảng các dòng 3701–3710, và theo dõi cách người dùng được chọn được gán vai trò. Bắt đầu bằng cách chạy hoặc tìm các bài kiểm thử chấp nhận lời mời, sau đó bổ sung kiểm thử hồi quy cho trường hợp email trùng lặp và trường hợp không có tài khoản đang hoạt động. Hoàn thành khi tài khoản đang hoạt động có email khớp chính xác được gán vai trò, và khi không có tài khoản đang hoạt động thì trả về 400 mà không thay đổi người chỉnh sửa hoặc người xem của kênh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Overview
Invitation.accept looks the invited user up again by email, case-insensitively, with no filter on active or deleted users and no ordering. When several user records share the email in different case, the role can go to an inactive or deleted record instead of the user who accepted. When an admin accepts an invitation for an email that has no account, accept adds None as an editor and the request fails with IntegrityError.
Complexity: Low
Target branch: hotfixes
Context
Invitation.acceptstarts withUser.objects.filter(email__iexact=self.email).first().- Reproduced:
- Active user
[email protected]accepts an invitation. An older inactive record[email protected]becomes the channel editor, and the accepting user doesn't. - An admin accepts an invitation for an email with no account, and gets 500 with
IntegrityErroron a nulluser_id.
- Active user
- Related: #4779, #3050. #6406 backports the invitee-only accept check to
hotfixes. #6405 depends on the same lookup onunstable.
The Change
- Accepting should give the role to the active account whose email exactly matches the invitation's. #5893 lets admins accept on an invitee's behalf, so the accepting user isn't always the invitee.
- Accepting an invitation with no matching active account should fail with a validation error and change nothing.
Acceptance Criteria
General
- When other records share the invitee's email in a different case, the active account with the exact email gets the role and no other record does.
- Accepting an invitation whose email has no active account returns 400 and leaves the channel's editors and viewers unchanged.
Testing
- Both reproduced cases in Context have regression tests.
AI usage
I scoped the audit. Claude Code found and reproduced these failures and drafted this issue.
- Ngôn ngữ chính
- Python
- Star
- 212
- Fork
- 321
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của learningequality/studio
-
Community library status changes don't update `date_updated`Có thể đã có người làm @LightCreator1007 đã nhận 1 ngày trước. Đang mởDEV: backend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
learningequality/studio#6414 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
learningequality/studio#6410 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/studio#6407 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/studio#6404 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/studio#6400 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của learningequality/studio
Issue tương tự
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingCó thể đã có người làm @yipinghuang1991 đã nhận hôm nay. Đang mởcomp/agent P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NousResearch/hermes-agent#156837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsCó thể đã có người làm @muskan-creates352 đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
fedora-infra/anitya#2188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs documentation need-triage SaaS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
integration:hermes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vectorize-io/hindsight#6601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage:product type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
dbt-labs/dbt-adapters#2333 ·
Maintainer thường phản hồi trong vòng 1 ngày