Skip to content

Commit

Permalink
Add some print statements for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield committed Dec 30, 2024
1 parent db9f1ca commit 2bb3956
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions posthog/api/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ def create(self, validated_data: dict[str, Any], **kwargs) -> Team:
def update(self, instance: Team, validated_data: dict[str, Any]) -> Team:
before_update = instance.__dict__.copy()

print("access_control check", validated_data) # noqa: T201
if "access_control" in validated_data and validated_data["access_control"] != instance.access_control:
print("in access control toggle") # noqa: T201
user = cast(User, self.context["request"].user)
posthoganalytics.capture(
str(user.distinct_id),
Expand All @@ -390,6 +392,7 @@ def update(self, instance: Team, validated_data: dict[str, Any]) -> Team:
},
groups=groups(instance.organization),
)
print("after access control toggle") # noqa: T201

if "survey_config" in validated_data:
if instance.survey_config is not None and validated_data.get("survey_config") is not None:
Expand Down
1 change: 1 addition & 0 deletions posthog/api/test/test_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ def test_access_control_toggle_capture(self, mock_capture):
new_setting = not current_access_control
response = self.client.patch(f"/api/environments/@current/", {"access_control": new_setting})
self.assertEqual(response.status_code, status.HTTP_200_OK)
print("response", response.json()) # noqa: T201

mock_capture.assert_called_with(
str(self.user.distinct_id),
Expand Down

0 comments on commit 2bb3956

Please sign in to comment.