feat(django): Gate user identity behind data_collection config#6868
Open
ericapisani wants to merge 2 commits into
Open
feat(django): Gate user identity behind data_collection config#6868ericapisani wants to merge 2 commits into
ericapisani wants to merge 2 commits into
Conversation
ericapisani
force-pushed
the
py-2583-django-user-info
branch
from
July 23, 2026 13:43
cb1a6ba to
0f5f3fa
Compare
ericapisani
marked this pull request as ready for review
July 23, 2026 13:44
ericapisani
marked this pull request as draft
July 23, 2026 13:54
Contributor
Codecov Results 📊✅ 96422 passed | ⏭️ 6370 skipped | Total: 102792 | Pass Rate: 93.8% | Execution Time: 351m 29s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 85.37%. Project has 2513 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.67% 89.67% —%
==========================================
Files 193 193 —
Lines 24321 24337 +16
Branches 8572 8586 +14
==========================================
+ Hits 21809 21824 +15
- Misses 2512 2513 +1
- Partials 1397 1399 +2Generated by Codecov Action |
ericapisani
marked this pull request as ready for review
July 23, 2026 14:33
Apply the data_collection.user_info setting to Django user identity (id, email, username) collection, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This mirrors the existing behavior for client IP/user info already shipped for Flask, WSGI, and ASGI. The user extraction logic in _after_get_response is pulled into a shared helper used by both the WSGI and ASGI event processors, and the parametrized send_default_pii/data_collection test matrix is extracted into tests/integrations/django/utils.py for reuse across the WSGI and ASGI test suites. Refs PY-2583
The new test was the only DB-touching test without @pytest.mark.forked. Running in the parent process leaked the created user into the shared in-memory sqlite DB (UNIQUE constraint failures in test_basic) and caused the parent to hold the session-scoped django_db_setup fixture, so forked children skipped postgres test DB creation but still destroyed it on teardown (database does not exist errors).
ericapisani
force-pushed
the
py-2583-django-user-info
branch
from
July 23, 2026 18:15
615580f to
4ee42d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apply the data_collection.user_info setting to Django user identity (id, email, username) collection, giving it precedence over the legacy send_default_pii boolean when explicitly configured. This mirrors the existing behavior for client IP/user info already shipped for Flask, WSGI, and ASGI.
The user extraction logic in _after_get_response is pulled into a shared helper used by both the WSGI and ASGI event processors, and the parametrized send_default_pii/data_collection test matrix is extracted into tests/integrations/django/utils.py for reuse across the WSGI and ASGI test suites.
Refs PY-2583
Refs #6746