Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(tasks): remove feature flag check from invite access validation (#57876)

Peter Kirkham0dd8a39b2282
diff --git a/products/tasks/backend/api.py b/products/tasks/backend/api.py
index d9d609ec6123..351e2ae0f59c 100644
--- a/products/tasks/backend/api.py
+++ b/products/tasks/backend/api.py
@@ -2475,25 +2475,7 @@ class CodeInviteViewSet(viewsets.ViewSet):
)
@action(detail=False, methods=["get"], url_path="check-access")
def check_access(self, request, **kwargs):
- user = request.user
-
- # Check feature flag if we can resolve an org
- org = getattr(user, "organization", None)
- if org is not None:
- org_id = str(org.id)
- flag_enabled = posthoganalytics.feature_enabled(
- "tasks",
- user.distinct_id,
- groups={"organization": org_id},
- group_properties={"organization": {"id": org_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
- if flag_enabled:
- return Response({"has_access": True})
-
- # Fallback: check invite code redemption
- has_redeemed = CodeInviteRedemption.objects.filter(user=user).exists()
+ has_redeemed = CodeInviteRedemption.objects.filter(user=request.user).exists()
return Response({"has_access": has_redeemed})