Skip to content

Conversation

@Yaannko
Copy link

@Yaannko Yaannko commented Dec 16, 2025

  • Issue: Several authentication-related settings in settings.py are deprecated and produce warnings.
  • Status: Resolved (Updated eventyay/config/next_settings.py to use ACCOUNT_LOGIN_METHODS and ACCOUNT_SIGNUP_FIELDS).
  • Action: None required for users using the latest codebase.

Summary by Sourcery

Update authentication configuration to use current django-allauth settings and align Python version requirements.

Bug Fixes:

  • Replace deprecated django-allauth authentication settings with supported ACCOUNT_LOGIN_METHODS and ACCOUNT_SIGNUP_FIELDS configuration.

Build:

  • Constrain supported Python versions to be >=3.11 and <3.13 in pyproject.toml.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 16, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Django allauth authentication configuration to use the new non-deprecated settings and adjusts the supported Python version range in pyproject.toml.

Flow diagram for updated django allauth authentication settings

flowchart TD
    subgraph Deprecated_settings
        A1[ACCOUNT_EMAIL_REQUIRED]
        A2[ACCOUNT_USERNAME_REQUIRED]
        A3[ACCOUNT_AUTHENTICATION_METHOD]
        A4[Commented ACCOUNT_LOGIN_METHODS]
        A5[Commented ACCOUNT_SIGNUP_FIELDS]
    end

    subgraph New_settings
        B1[ACCOUNT_LOGIN_METHODS email]
        B2[ACCOUNT_SIGNUP_FIELDS email password1 password2]
        B3[ACCOUNT_USER_MODEL_USERNAME_FIELD None]
    end

    Developer[Developer updating settings] --> A1
    Developer --> A2
    Developer --> A3
    Developer --> A4
    Developer --> A5

    A1 -->|replaced by| B1
    A2 -->|replaced by| B1
    A3 -->|replaced by| B1
    A4 -->|uncommented and used| B1
    A5 -->|uncommented and simplified| B2

    B1 --> AllauthCore[django_allauth authentication flow]
    B2 --> AllauthCore
    B3 --> AllauthCore

    AllauthCore --> LoginBehavior[Login via email only]
    AllauthCore --> SignupBehavior[Signup requires email password1 password2]
Loading

File-Level Changes

Change Details Files
Switch to new django-allauth login and signup settings to replace deprecated configuration.
  • Uncomment and enable ACCOUNT_LOGIN_METHODS using the supported set syntax with 'email'.
  • Uncomment and enable ACCOUNT_SIGNUP_FIELDS with plain field names instead of the old required-field suffix format.
  • Remove now-deprecated ACCOUNT_EMAIL_REQUIRED, ACCOUNT_USERNAME_REQUIRED, and ACCOUNT_AUTHENTICATION_METHOD settings to rely on the new configuration defaults.
app/eventyay/config/next_settings.py
Constrain supported Python versions to below 3.13 in the packaging metadata.
  • Change requires-python specifier to ">=3.11,<3.13" to prevent installation on unsupported Python 3.13+ interpreters.
app/pyproject.toml

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The ACCOUNT_SIGNUP_FIELDS change drops the * markers that previously denoted required fields; if you still rely on those constraints, consider explicitly configuring required fields via allauth’s current settings (e.g., form or field configuration) to preserve the same validation behavior.
  • The duplicated NOTE comment above the allauth settings can be simplified to a single line to avoid redundancy in next_settings.py.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `ACCOUNT_SIGNUP_FIELDS` change drops the `*` markers that previously denoted required fields; if you still rely on those constraints, consider explicitly configuring required fields via allauth’s current settings (e.g., form or field configuration) to preserve the same validation behavior.
- The duplicated NOTE comment above the allauth settings can be simplified to a single line to avoid redundancy in `next_settings.py`.

## Individual Comments

### Comment 1
<location> `README.rst:107` </location>
<code_context>
 7. **Activate virtual environment**

-After running ``uv sync```, activate a virtual environment
+   All python commands must be run within the project's virtual environment. You have two options:

-.. code-block:: sh
</code_context>

<issue_to_address>
**suggestion (typo):** Consider capitalizing "Python" as it refers to the programming language.

Please use "Python" with a capital P here to match standard language naming conventions.

Suggested implementation:

```
   All Python commands must be run within the project's virtual environment. You have two options:

```

```
   Prepend ``uv run`` to any Python command to run it in the environment without explicit activation.

```
</issue_to_address>

### Comment 2
<location> `README.rst:117` </location>
<code_context>
+
+   **Option B: Use `uv run`**
+
+   Prepend ``uv run`` to any python command to run it in the environment without explicit activation.
+
+   .. code-block:: sh
</code_context>

<issue_to_address>
**suggestion (typo):** Consider capitalizing "Python" here as well for consistency.

This matches standard documentation style and the other references to the language in this document.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses deprecation warnings from django-allauth by migrating from the older authentication settings (ACCOUNT_EMAIL_REQUIRED, ACCOUNT_USERNAME_REQUIRED, ACCOUNT_AUTHENTICATION_METHOD) to the newer recommended settings (ACCOUNT_LOGIN_METHODS, ACCOUNT_SIGNUP_FIELDS). The PR also constrains Python versions to 3.11-3.12 and improves the README documentation for virtual environment activation.

  • Migrates django-allauth settings to current non-deprecated configuration
  • Restricts Python version support to >=3.11 and <3.13
  • Enhances README with clearer virtual environment activation instructions

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
app/pyproject.toml Adds upper bound constraint to Python version requirement, limiting to <3.13
app/eventyay/config/next_settings.py Replaces deprecated allauth settings with ACCOUNT_LOGIN_METHODS and ACCOUNT_SIGNUP_FIELDS
README.rst Expands virtual environment activation section with two alternative approaches (activate vs uv run)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html
# ACCOUNT_LOGIN_METHODS = {'email'}
# ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*']
# NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

Duplicate NOTE comment. This line is identical to line 1115 and should be removed.

Suggested change
# NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html

Copilot uses AI. Check for mistakes.
# ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*']
# NOTE: django-allauth changed some settings name. Check https://docs.allauth.org/en/dev/release-notes/recent.html
ACCOUNT_LOGIN_METHODS = {'email'}
ACCOUNT_SIGNUP_FIELDS = ['email', 'password1', 'password2']
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

According to django-allauth documentation, required fields in ACCOUNT_SIGNUP_FIELDS should be marked with an asterisk suffix. The previous commented-out configuration used 'email*', 'password1*', 'password2*' to indicate required fields. The current configuration removes these asterisks, which may inadvertently make these fields optional. Consider changing to ['email*', 'password1*', 'password2*'] to maintain the required field behavior.

Suggested change
ACCOUNT_SIGNUP_FIELDS = ['email', 'password1', 'password2']
ACCOUNT_SIGNUP_FIELDS = ['email*', 'password1*', 'password2*']

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant