feat: add invitation flow to invite users#3844
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b5cf67fcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c985d1feaf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3844 +/- ##
==========================================
- Coverage 88.52% 88.51% -0.01%
==========================================
Files 71 72 +1
Lines 10885 11120 +235
Branches 981 1001 +20
==========================================
+ Hits 9636 9843 +207
- Misses 916 933 +17
- Partials 333 344 +11 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba1085f7d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This allows bringing in users for newly created subscription.
| users = {} | ||
| if username := profile.get("username"): | ||
| query |= Q(username=username) | ||
| for user in User.objects.filter(username=username): | ||
| if user.username == username: | ||
| users[user.pk] = user | ||
| if email := profile.get("email"): | ||
| query |= Q(email__iexact=email) | ||
| if not query: | ||
| return [] | ||
| return list(User.objects.filter(query).distinct()) | ||
| for user in User.objects.filter(email__iexact=email): | ||
| users[user.pk] = user | ||
| return list(users.values()) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6523e74fd2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| users = {} | ||
| if username := profile.get("username"): | ||
| for user in self.users_by_username.get(str(username).casefold(), []): | ||
| for user in self.users_by_username.get(str(username), []): |
There was a problem hiding this comment.
Restore case-insensitive username lookup in preloaded sync
In the preloaded path (sync_hosted_users -> SamlSyncContext.preload -> sync_saml_payload), this exact-key lookup drops legacy username matches that differ only by case. With a payload like username='alice' and an existing local user Alice (and no matching email), get_legacy_candidates() now returns no candidate and sync_saml_identity() creates a new user (alice-1) and links the hosted identity there, splitting one person across two local accounts. This is a regression from the previous casefolded lookup and can corrupt identity linkage during hosted user syncs.
Useful? React with 👍 / 👎.
This allows bringing in users for newly created subscription.