Accepting an invitation gives the role to a user record looked up by email
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Domínio
- authentication, backend
Direção de pesquisa
Leia Invitation.accept em contentcuration/contentcuration/models.py, por volta das linhas 3701–3710, e acompanhe como a função atribui a função ao usuário selecionado. Comece executando ou localizando os testes de aceitação de convites e, em seguida, adicione cobertura de regressão para os casos de e-mail duplicado e de ausência de uma conta ativa. O trabalho estará concluído quando a conta ativa com o e-mail exato receber a função e a ausência de uma conta ativa retornar 400 sem alterar os editores ou visualizadores do canal.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 212
- Forks
- 321
- Merge médio
- 1d 7h
- PRs com merge (30d)
- 14
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de learningequality/studio
-
Community library status changes don't update `date_updated`Talvez já em andamento @ArpitaSamanta10 assumiu hoje. Abertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
learningequality/studio#6414 · 8 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
DEV: backend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
learningequality/studio#6410 ·
Mantenedores costumam responder em até 1 dia
-
DEV: backend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
learningequality/studio#6407 ·
Mantenedores costumam responder em até 1 dia
-
Stripe webhook accepts events when no webhook secret is configuredTalvez já em andamento @adibmbrk assumiu hoje. Abertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
learningequality/studio#6404 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Contentnode `requisites` action skips the permission checkTalvez já em andamento @sreehari-vp assumiu hoje. Abertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
learningequality/studio#6400 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de learningequality/studio
Issues semelhantes
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 76/100
samuelclay/NewsBlur#2214 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
MODEL_NOT_FOUND gives no suggestion for a model listed only as model:profileTalvez já em andamento @ShaiShmuel assumiu hoje. Abertaenhancement rust
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
superlinked/sie#985 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
readthedocs/readthedocs-builder#73 ·
Mantenedores costumam responder em até 1 dia