fix: use global id for user sync filtering #2992
Draft
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.
What are the relevant tickets?
#8421
Description (What does it do?)
This PR updates our bulk HubSpot contact sync to reflect our SCIM-based provisioning. Historically we filtered bulk “create --users” by requiring a social_auth record, which made sense when most real users logged in interactively. Since SCIM now provisions many legitimate users without social_auth, those users were excluded from bulk syncs and not synced to hubspot.
We now select users with
is_active=True
, a valid email, and global_id present, replacing the social_auth check. This aligns bulk backfills with registration and --ids flows and ensures SCIM-provisioned users are included.How can this be tested?
python manage.py sync_db_to_hubspot create --users
and verify: