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.

chore(data-warehouse): read the team via get_team in the draft serializer (#95606)

Jovan Sakovicd3f2e35a321c
diff --git a/products/data_warehouse/backend/presentation/views/saved_query_draft.py b/products/data_warehouse/backend/presentation/views/saved_query_draft.py
index cad885a9604c..d02dd86434fc 100644
--- a/products/data_warehouse/backend/presentation/views/saved_query_draft.py
+++ b/products/data_warehouse/backend/presentation/views/saved_query_draft.py
@@ -28,7 +28,7 @@ class DataWarehouseSavedQueryDraftSerializer(serializers.ModelSerializer):
return value
def create(self, validated_data):
- validated_data["team_id"] = self.context["team_id"]
+ validated_data["team_id"] = self.context["get_team"]().id
validated_data["created_by"] = self.context["request"].user
saved_query_id = validated_data.get("saved_query_id")