Accepting an invitation gives the role to a user record looked up by email
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- django, python
- Domain
- authentication, backend
Research direction
Read Invitation.accept in contentcuration/contentcuration/models.py around lines 3701–3710 and trace how the selected user is assigned the role. Start by running or locating the invitation acceptance tests, then add regression coverage for the duplicate-email and no-active-account cases. Done means the exact-email active account receives the role, and a missing active account returns 400 without changing channel editors or viewers.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- JavaScript
- Stars
- 214
- Forks
- 327
- Avg merge
- 17h 5m
- Merged PRs (30d)
- 25
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from learningequality/studio
-
Community library status changes don't update `date_updated`Possibly taken @ArpitaSamanta10 claimed this 13 days ago. Opencommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
learningequality/studio#6414 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Activation key can activate a different account whose email differs only in casePossibly taken @Madhu-priya123 claimed this 4 days ago. OpenDEV: backend
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
learningequality/studio#6410 · 2 comments ·
Maintainers usually reply within 1 day
-
DEV: backend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
learningequality/studio#6407 ·
Maintainers usually reply within 1 day
-
Stripe webhook accepts events when no webhook secret is configuredPossibly taken @adibmbrk claimed this 14 days ago. Opencommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
learningequality/studio#6404 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Contentnode `requisites` action skips the permission checkPossibly taken @sreehari-vp claimed this 13 days ago. Opencommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
learningequality/studio#6400 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in learningequality/studio
Similar issues
-
enhancement good first issue shields parity
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
seuthootDev/terminal-shields#125 ·
Maintainers usually reply within 2 days
-
[ui] 自創球員 (投手): pick 球種 at creation (直球 fixed + up to 2 more), trade-off line, shown on the cardOpenarea:ui P1 status:doing
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
sunososobro-hub/cloudball#1153 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NuSkooler/enigma-bbs#1241 ·
Maintainers usually reply within 1 day
-
harness seguranca target:staging
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
corosolto/client#1507 · 1 comment ·
Maintainers usually reply within 1 day