← Back to Pull requests

[20.0][MIG] auth_signup_verify_email: Migration to 20.0 #1064

Open
unknown opened this pull request with 579 lines diff across 7 files
View on GitHub
unknown unknown commented on Nov 10, 2026 14:11 UTC
Author

Migration of auth_signup_verify_email to 20.0.

It carries the 19.0 migration too

The module is not in the 19.0 branch: its migration, #905, is still open, so
this PR is built on top of it. The history here is #905's plus one
[IMP] pre-commit auto fixes and one [MIG] … Migration to 20.0. The OCA
migration guide allows skipping a version when the intermediate guides' tasks
are done, and #905's [MIG] covers 19.0.

If #905 (or #1034, a second 19.0 migration of the same module) is merged first,
this PR should be rebased on it.

What 20.0 needed

  • ir.config_parameter.set_param is gone (odoo/odoo@a4f2879697a7), replaced by

  • typed setters → set_str.
  • website.get_current_website is gone (odoo/odoo@2545a833c8e4). The

  • replacement is the env.website property, with an explicit fallback, which is
    what core 20.0 does in website/models/ir_http.py.
  • The website model is now declared in base

  • (odoo/addons/base/models/website.py), so "website" in self.env no longer
    tells whether the website module is installed. The test now checks for the
    field instead. Without this the two existing tests error with
    AttributeError: 'website' object has no attribute 'auth_signup_uninvited'.
    The default website record moved too: website.default_website →
    base.default_website.

    Fix: the activation page had no password fields

    only_passwords was dropped from core in 19.0, and the module still used it in
    the t-if of the password fields, so they were hidden on every page that
    renders auth_signup.fields — including /web/reset_password?token=..., which
    is where this module's own activation mail points. Public signup could not be
    completed. Details and measurements in
    https://github.com/OCA/server-auth/pull/905#issuecomment-6769337032.

    The xpaths now use token and not invalid_token, which is the expression Odoo
    18 assigned to only_passwords. Behaviour is back to 18.0: fields shown with a
    token, hidden on free signup.

    test_activation_page_asks_for_password covers it — it signs up, prepares a
    reset token and asserts the password inputs are on the page. Validated red →
    green: without the fix only that test fails.

    pre-commit

    BLE001 and TRY401 fire in controllers/main.py on this branch. .ruff.toml
    is identical in 19.0 and 20.0; what changed is the hook bump (ruff
    v0.13.0 → v0.16.8), and since the config only sets extend-select, ruff's
    wider default rule set now applies. Fixed in code so the check is green:
    TRY401 by dropping the redundant exception object (logging.exception already
    attaches it), BLE001 with a # noqa — narrowing the except Exception would
    change behaviour, since an unexpected error would stop being rendered as a form
    error. If OCA/oca-addons-repo-template#372 lands and the repo is updated, both
    rules stop applying and the # noqa can go.

    Review changes

    Folded into the [MIG] commit:

  • The password xpath now requires label[@for='password'], since in 20.0

  • auth_signup.fields nests a second div.field-password inside
    div.field-confirm_password.
  • signup_login_fields is removed: core 20.0 already renders type="email"

  • on the signup login input.
  • The passwordless signup only runs on POST without a signup token. GET

  • requests and token signups (activation, reset, invitation) go to core.
  • The values passed to signup() come from an allow-list (login, name,

  • empty password) instead of all of request.params, which end up in a
    sudo copy() of the template user. The email is taken from login, so the
    activation mail can't be sent to another address. Core's guard runs first:
    404 when signup is disabled.
  • The request language is passed to signup(), as core's

  • _prepare_signup_values does, so the activation email is not sent in the
    template user's language.
  • New tests: signup page without password fields, extra params (including

  • email) ignored, 404 when signup is disabled, duplicate email rejected, GET
    never signs up, token signups left to core.

    Notes for reviewers

  • No migration script. The module defines no models or fields and has no

  • data//demo/. #1034 adds an upgrades/ script that drops stale
    website-specific copies of auth_signup.signup, because they broke
    validation of signup_login_fields. That view is gone; the only remaining
    view inherits auth_signup.fields, so the script is not needed here.

    The original [MIG] changes were installed and tested on a clean 20.0
    database with demo data, with auth_password_policy_signup also installed. The
    review changes were not run locally; CI covers them.

    Diff: 579 lines (+434 / -145) across 7 files Reviewer: weinni2000 Review duration: 32524m
    All Vouch review confidence checks passed
    Residual risk 0.39 = Change Risk (0.73) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.73 · 579 lines diff across 7 files
    0.73
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.381
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.073
    Real PR Conversation Timeline
    1 comments
    "Review active on #1064"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 73% (HIGH) · Higher = larger blast radius
    73%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 38.9% · Moderate risk
    38.9%