Skip to content

[20.0][MIG] auth_signup_verify_email: 20.0 changes only (review view of OCA/server-auth#1064) - #1

Open
weinni2000 wants to merge 1 commit into
20.0-auth_signup_verify_email-precommitfrom
20.0-mig-auth_signup_verify_email
Open

weinni2000 wants to merge 1 commit into
20.0-auth_signup_verify_email-precommitfrom
20.0-mig-auth_signup_verify_email

Conversation

@weinni2000

@weinni2000 weinni2000 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Review aid for OCA#1064. The OCA PR also carries the module's full history and the open 19.0 migration (OCA#905), which makes its diff hard to read.

This diff contains only what the 20.0 migration changes. Not meant to be merged.

🤖 Generated with Claude Code

Summary by Sourcery

Migrate auth_signup_verify_email to Odoo 20.0 while preserving password verification during signup activation.

Bug Fixes:

  • Ensure the signup activation page continues to provide password and confirmation fields.

Enhancements:

  • Update the module for Odoo 20.0, including current website detection and configuration APIs.
  • Improve passwordless signup error handling and logging.

Tests:

  • Add coverage verifying that activation links expose the password setup fields.

@sourcery-ai

sourcery-ai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Update exception handling and logging in passwordless signup for the 20.0 migration.

  • auth_signup_verify_email/controllers/main.py L39, L57-59

UI

Show password fields only on valid token-based signup pages so users can set a password from the activation link.

  • auth_signup_verify_email/views/signup.xml L7-10

Configuration

Bump the module version to 20.0.

  • auth_signup_verify_email/__manifest__.py L6

Tests

Adapt website and configuration setup for 20.0, and verify the activation page offers password fields.

  • auth_signup_verify_email/tests/test_verify_email.py L20-27, L56-72

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="auth_signup_verify_email/tests/test_verify_email.py" line_range="25" />
<code_context>
             # Enable public signup in website if it is installed; otherwise
             # tests here would fail
-            current_website = self.env["website"].get_current_website()
+            current_website = self.env.website or self.env.ref("base.default_website")
             current_website.auth_signup_uninvited = "b2c"
-        self.env["ir.config_parameter"].set_param("auth_signup.invitation_scope", "b2c")
</code_context>
<issue_to_address>
**Signup tests crash with website installed**

When the website signup field is present in the registry, `UICase.setUp` evaluates `self.env.website` at line 25; Odoo models are accessed through `self.env["website"]`, so this raises `AttributeError` and the UI tests abort before running.

Access the website model with `self.env["website"]` before selecting the current or default website.
</issue_to_address>

### Comment 2
<location path="auth_signup_verify_email/views/signup.xml" line_range="7" />
<code_context>
     <template id="signup_fields" inherit_id="auth_signup.fields">
         <xpath expr="//div[hasclass('field-password')]" position="attributes">
-            <attribute name="t-if">only_passwords</attribute>
+            <attribute name="t-if">token and not invalid_token</attribute>
         </xpath>
         <xpath expr="//div[hasclass('field-confirm_password')]" position="attributes">
</code_context>
<issue_to_address>
**Password setup docs mislead users**

When an activating user follows the documented signup flow, the signup template renders password fields on the activation-link page, while the README says users are asked for a password only at their first login attempt; people following the documented flow encounter a different password-setting step.

Update the README to explain that users set their password from the activation link before their first login.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: auth_signup_verify_email/tests/test_verify_email.py:25


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

# Enable public signup in website if it is installed; otherwise
# tests here would fail
current_website = self.env["website"].get_current_website()
current_website = self.env.website or self.env.ref("base.default_website")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Signup tests crash with website installed

When the website signup field is present in the registry, UICase.setUp evaluates self.env.website at line 25; Odoo models are accessed through self.env["website"], so this raises AttributeError and the UI tests abort before running.

Access the website model with self.env["website"] before selecting the current or default website.

Prompt for AI agents
In `auth_signup_verify_email/tests/test_verify_email.py` at line 25:

**Signup tests crash with website installed**

When the website signup field is present in the registry, `UICase.setUp` evaluates `self.env.website` at line 25; Odoo models are accessed through `self.env["website"]`, so this raises `AttributeError` and the UI tests abort before running.

Access the website model with `self.env["website"]` before selecting the current or default website.

<template id="signup_fields" inherit_id="auth_signup.fields">
<xpath expr="//div[hasclass('field-password')]" position="attributes">
<attribute name="t-if">only_passwords</attribute>
<attribute name="t-if">token and not invalid_token</attribute>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Low · Password setup docs mislead users

When an activating user follows the documented signup flow, the signup template renders password fields on the activation-link page, while the README says users are asked for a password only at their first login attempt; people following the documented flow encounter a different password-setting step.

Update the README to explain that users set their password from the activation link before their first login.

Prompt for AI agents
In `auth_signup_verify_email/views/signup.xml` at line 7:

**Password setup docs mislead users**

When an activating user follows the documented signup flow, the signup template renders password fields on the activation-link page, while the README says users are asked for a password only at their first login attempt; people following the documented flow encounter a different password-setting step.

Update the README to explain that users set their password from the activation link before their first login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants