🦔 PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
If someone is using the API to create invites, it's possible to create multiple invites for the same user. This is fine but not ideal, esp if someone is using the private_project_access field on the invites to specify projects someone should get access to when they join.
Changes
When creating an invite, the combine_pending_invites field can be optionally applied.
If True, non-expired pending invoices are combined, getting the highest access level specified on any invite and using those for the resulting invite. Old invites are deleted.
If False (default), just delete the old invite and create a new one with the current invite info being supplied via the request.
Problem
If someone is using the API to create invites, it's possible to create multiple invites for the same user. This is fine but not ideal, esp if someone is using the
private_project_access
field on the invites to specify projects someone should get access to when they join.Changes
When creating an invite, the
combine_pending_invites
field can be optionally applied.👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
Should!
How did you test this code?
Added a few tests.