diff --git a/posthog/api/team.py b/posthog/api/team.py index 8fc028cc65933..d5cfc4e261fce 100644 --- a/posthog/api/team.py +++ b/posthog/api/team.py @@ -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), @@ -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: diff --git a/posthog/api/test/test_team.py b/posthog/api/test/test_team.py index 32c35f8f14b78..d93f296c4c07f 100644 --- a/posthog/api/test/test_team.py +++ b/posthog/api/test/test_team.py @@ -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),