Skip to content

Commit

Permalink
fix feature flag handling for endpoints without auth
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Sep 27, 2023
1 parent ab76dcb commit 77822d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions posthog/hogql_queries/legacy_compatibility/feature_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def hogql_insights_enabled(user: User) -> bool:

# on PostHog Cloud, use the feature flag
if is_cloud():
if not hasattr(user, "distinct_id"): # exclude api endpoints that don't have auth from the flag
return False

return posthoganalytics.feature_enabled(
"hogql-insights",
user.distinct_id,
Expand Down

0 comments on commit 77822d5

Please sign in to comment.