Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades django-allauth to version 65.16.0 and migrates deprecated authentication settings to the new ACCOUNT_SIGNUP_FIELDS and ACCOUNT_LOGIN_METHODS configuration, while maintaining backward compatibility. It also introduces new test utilities for OpenID Connect and updates documentation and serializers accordingly. Feedback points out a potential AttributeError in the test suite, a grammatical error in the documentation, and suggests improvements for request method checks and test assertions.
| email = data.get("email") | ||
| # Email is required on post | ||
| if request.method in ("POST") and settings.ACCOUNT_EMAIL_REQUIRED and not email: | ||
| if request.method in ("POST") and "email*" in getattr(settings, "ACCOUNT_SIGNUP_FIELDS", []) and not email: |
There was a problem hiding this comment.
The expression request.method in ("POST") is logically equivalent to request.method in "POST" because ("POST") is a string literal, not a tuple. This could lead to unexpected behavior if request.method were a substring of "POST" (e.g., "P"). It is safer and clearer to use equality or a proper tuple.
| if request.method in ("POST") and "email*" in getattr(settings, "ACCOUNT_SIGNUP_FIELDS", []) and not email: | |
| if request.method == "POST" and "email*" in getattr(settings, "ACCOUNT_SIGNUP_FIELDS", []) and not email: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #14145 +/- ##
==========================================
- Coverage 74.62% 74.51% -0.12%
==========================================
Files 958 959 +1
Lines 57891 58198 +307
Branches 7889 7946 +57
==========================================
+ Hits 43202 43364 +162
- Misses 12927 13053 +126
- Partials 1762 1781 +19 🚀 New features to boost your workflow:
|
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Fixes #14144
Changes:
django-allauthto65.16.0.Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.