Accepting an invitation gives the role to a user record looked up by email
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- authentication, backend
Direzione di ricerca
Leggi Invitation.accept in contentcuration/contentcuration/models.py, intorno alle righe 3701–3710, e segui il modo in cui il ruolo viene assegnato all’utente selezionato. Inizia eseguendo o individuando i test di accettazione degli inviti, poi aggiungi test di regressione per i casi di email duplicata e di assenza di un account attivo. Il lavoro è terminato quando l’account attivo con l’email esatta riceve il ruolo e l’assenza di un account attivo restituisce 400 senza modificare gli editor o i visualizzatori del canale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 321
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/studio
-
Community library status changes don't update `date_updated`Forse già presa @LightCreator1007 l’ha presa 1 giorno fa. ApertaDEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
learningequality/studio#6414 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
learningequality/studio#6410 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6407 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6404 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/studio
Issue simili
-
[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 retryingForse già presa @yipinghuang1991 l’ha presa oggi. Apertacomp/agent P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NousResearch/hermes-agent#156837 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsForse già presa @muskan-creates352 l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
fedora-infra/anitya#2188 ·
I maintainer di solito rispondono entro 1 giorno
-
docs documentation need-triage SaaS
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
integration:hermes
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
vectorize-io/hindsight#6601 ·
I maintainer di solito rispondono entro 1 giorno
-
triage:product type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
dbt-labs/dbt-adapters#2333 ·
I maintainer di solito rispondono entro 1 giorno