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.

Copy link
Member

@Sak1012 Sak1012 left a comment

Choose a reason for hiding this comment

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

Please remove the changes made in the other files apart from app/eventyay/config/next_settings.py and take a look at the co-pilot suggestions and resolve them.

@Yaannko
Copy link
Author

Yaannko commented Dec 17, 2025

Please remove the changes made in the other files apart from app/eventyay/config/next_settings.py and take a look at the co-pilot suggestions and resolve them.

Applied all the changes , according to the copilot

@Yaannko Yaannko requested a review from Sak1012 December 17, 2025 16:32
Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please resolve conflicts and add screenshots to document that you were able to get the system running with these changes.

@mariobehling mariobehling changed the title Fix : Deprecated Django/Allauth Settings Fix: Deprecated Django/Allauth Settings Dec 20, 2025
@Yaannko
Copy link
Author

Yaannko commented Dec 21, 2025

@mariobehling hey If this okay , can we merge it ?

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

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


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

Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please resolve Docker build failure.

Copy link
Member

@norbusan norbusan left a comment

Choose a reason for hiding this comment

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

You updated all the python packages to new versions, which is independent of the change.

Have you verified that all functionality is still working after the upgrade?

Furthermore, I prefer changes to be orthogonal

  • one change (PR) that does the auth changes
  • one change (PR) that does the package updates

That way it is easy to revert if something goes wrong.

@Yaannko
Copy link
Author

Yaannko commented Dec 21, 2025

You updated all the python packages to new versions, which is independent of the change.

Have you verified that all functionality is still working after the upgrade?

Furthermore, I prefer changes to be orthogonal

  • one change (PR) that does the auth changes
  • one change (PR) that does the package updates

That way it is easy to revert if something goes wrong.

Okay Sir ,

@Yaannko
Copy link
Author

Yaannko commented Dec 21, 2025

You updated all the python packages to new versions, which is independent of the change.

Have you verified that all functionality is still working after the upgrade?

Furthermore, I prefer changes to be orthogonal

  • one change (PR) that does the auth changes
  • one change (PR) that does the package updates

That way it is easy to revert if something goes wrong.

I raise another PR for the auth changes into #1563


. .venv/bin/activate

**Option B: Use `uv run`**
Copy link
Member

Choose a reason for hiding this comment

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

Wrong RST markup.

"defusedxml>=0.7.1",
"dj-static>=0.0.6",
"django>=5.2.5",
"django>=4.2,<5.2",
Copy link
Member

Choose a reason for hiding this comment

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

Why downgrading Django?

"starkbank-ecdsa>=2.2.0",
"static3>=0.7.0",
"stripe>=11.3.0",
"stripe==11.3.*",
Copy link
Member

Choose a reason for hiding this comment

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

Why have to make change?

Copy link
Member

Choose a reason for hiding this comment

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

This file is no longer used, why make change?

Copy link
Member

Choose a reason for hiding this comment

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

This file is no longer used.

@mariobehling
Copy link
Member

Hello @Yaannko please follow up on this PR. Thanks!

@hongquan
Copy link
Member

hongquan commented Jan 5, 2026

django-allauth settings has been updated as part of #1625

@hongquan hongquan closed this Jan 5, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in Eventyay Next Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants