-
Notifications
You must be signed in to change notification settings - Fork 170
Fix : Deprecated Django/Allauth Settings #1515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…d virtual environment, not the system Python environment.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates 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 settingsflowchart 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]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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_FIELDSchange 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this 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.
Sak1012
left a comment
There was a problem hiding this 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.
Applied all the changes , according to the copilot |
dbf7e1b to
124b701
Compare
settings.pyare deprecated and produce warnings.eventyay/config/next_settings.pyto useACCOUNT_LOGIN_METHODSandACCOUNT_SIGNUP_FIELDS).Summary by Sourcery
Update authentication configuration to use current django-allauth settings and align Python version requirements.
Bug Fixes:
Build: