Mirror CMP pending-confirmation registration and allauth email verification (68789580)

未关闭
#472 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
20/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃
技术栈
django, playwright, python

调研方向

Start by reading AGENTS.md and the linked specs, then await the landed CMP intake 4169043a contract and report before mirroring. Extend accounts/services/email_verification.py and send_registration_confirmation_mail for pending/confirmed states, typo/MX checks, resend. Done means all owner acceptance criteria pass: unit and Playwright tests green, migration safe, dashboard resend shown, DEV deployed before prod.

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

描述

auth courses email enhancement P1

Outcome and authority

Mirror the primary CMP email-confirmation behavior for course registration and allauth signup, with clear pending/confirmed states, correction/resend, typo/MX validation, member visibility, and migration safety. Hub intake 68789580-eb52-4b27-8d3b-355befb5e557; CMP intake 4169043a is primary. Do not change which registration form is canonical.

The exact owner acceptance criteria below control this bounded mirror. These references do not authorize unrelated account/profile or registration redesign.

Repository findings and scope

At base 35a023da73e9f61173f82e273eea8c001b11830c, accounts/services/email_verification.py already uses allauth EmailAddress, EmailConfirmationHMAC, and the account_confirm_email route. course_management.package_mail.send_registration_confirmation_mail incorporates this verification link into the existing package-mail message rather than creating a separate pipeline. Extend and document that implementation as requested. Website ACCOUNT_EMAIL_VERIFICATION is currently none; allauth signup currently uses the existing signup template. Implement only the explicitly requested confirmation behavior, without using this task to redesign authentication.

The website's existing CourseRegistration.status represents operator approval (pending means pending review). Email ownership confirmation is a separate requirement: preserve the existing approval semantics and coordinate with the application-notification mirror rather than silently making confirmation approve an application or making review approve an email address. The landed primary contract must settle the precise representation and transitions; do not invent a new verification model.

Typo suggestions must match the primary and remain suggestions with its correction semantics. The owner distinguishes a conclusive absent/null MX result (reject) from lookup failure/timeout (safe log and allow registration to continue); preserve that distinction with bounded lookup time and no address/DNS-detail leakage in logs.

Dependencies and coordination

Implementation prerequisite: settled/landed CMP intake 4169043a, its exact commits, and /home/alexey/tmp/agent-reports/cmp-registration-confirmation-ui-2026-10-24.md. At intake inspection, the report was absent and the primary candidate uncommitted in /home/alexey/git/cmp-regconfirm; that was not an accepted handoff. Record its final SHA/contract before mirroring, including typo semantics, pending/confirmed transitions, correction, resend throttling, and migration applicability. Read-only preparation may proceed while it settles.

Coordinate overlap in registration confirmation mail and post-submit templates with application-notification issue #471 and the registration contacts hook with #470. Preserve approval-specific copy, existing consent, recipient identities, and sibling work. Sibling landing requires fresh-main integration and the intake's rebase before every push.

Non-goals

No canonical-form decision, approval-policy change, new parallel verification model, second confirmation-mail pipeline, unrelated profile/authentication redesign, data deletion, real-user email, sensitive logging, shared git stash, or PR. The requested data migration preserves applicable existing registrations/accounts; it does not grant authority to manufacture unrelated verification evidence or alter historical consent.

Owner acceptance criteria (unchanged)

  • Course registration and allauth signup show “check your inbox” with the submitted address, explain that clicking the confirmation link is mandatory, and offer “wrong email? fix it” and rate-limited resend.
  • Registration remains pending confirmation until the link is clicked; confirmation is idempotent; expired/invalid links show a clear page with resend. Extend accounts/services/email_verification.py, reusing allauth EmailAddress and account_confirm_email inside send_registration_confirmation_mail; do not create a parallel model or mail pipeline. Confirmation emails use Relay. Document the existing implementation in the delivery report.
  • Match CMP’s typo suggestion list and semantics, including hmail.com, gmial.com, gmai.com, gmail.co, gmail.con, yahooo.com, hotmial.com, and outlok.com. Reject domains without MX, including null MX. Bound DNS lookup time; log failures/timeouts without blocking registration.
  • Dashboard/profile shows pending registrations/email and a resend button.
  • A data migration preserves existing registrations/accounts as confirmed/verified where applicable.
  • Copy and behavior match the settled primary report/commits.
  • Unit coverage includes typo suggestions, MX/null MX, non-blocking DNS failure/timeout, pending-to-confirmed transition, tokens, resend, correction, and migration. Browser coverage exercises registration, pending page, confirmation link, confirmed state, and dashboard resend. Existing suite passes.
  • Deliver from a fresh origin/main worktree; rebase on fresh origin/main before each push; push HEAD:main without a PR; clean up the branch/worktree. Follow AGENTS.md, use uv, preserve sibling changes, and never stash shared worktrees.
  • Deploy DEV before production and report source SHAs and CI/deploy run IDs. No data deletions, real-user emails, or sensitive logging. Any live test email uses only the owner-authorized test recipient.

Verification scenarios and handoff

Django/integration: exercise the exact requested typo list, absent/null MX, bounded non-blocking DNS failure/timeout, pending-to-confirmed transition, valid/idempotent/invalid/expired tokens, rate-limited resend, wrong-address correction, and migration behavior. Reuse allauth ownership evidence and the existing Relay mail path. Preserve operator-review state while checking email confirmation. Existing baseline tests are evidence of current behavior, not acceptance of the new contract.

Browser: follow registration -> check-inbox/pending page -> confirmation link -> confirmed state -> dashboard/profile resend, including wrong-email correction and expired/invalid-link recovery. Inspect process-required desktop/mobile screenshots of the changed states and run the applicable Playwright tier from the exact verification plan.

Operations: record the accepted primary contract, source SHAs, required exact-base/head verification evidence, DEV-before-prod CI/deploy run IDs, test-only live verification, and task worktree/branch cleanup. The engineer hands off an uncommitted frozen candidate; independent tester PASS precedes final PM acceptance.

主要语言
Python
星标
0
派生
0
平均合并
1 分钟
30 天内合并 PR
2

环境准备

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

从这里开始

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

DataTalksClub/website 的其他 Issue

查看 DataTalksClub/website 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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