Skip to content

Commit

Permalink
chore: add groups to billing limit events (#21307)
Browse files Browse the repository at this point in the history
* Add groups to billing limit events

* Use the groups function

* make sure team exists
  • Loading branch information
zlwaterfield authored Apr 3, 2024
1 parent 7b861d0 commit 056300f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ee/api/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.cloud_utils import get_cached_instance_license
from posthog.models import Organization
from posthog.event_usage import groups

logger = structlog.get_logger(__name__)

Expand Down Expand Up @@ -74,6 +75,9 @@ def patch(self, request: Request, *args: Any, **kwargs: Any) -> Response:
distinct_id,
"billing limits updated",
properties={**custom_limits_usd},
groups=groups(org, self.request.user.team)
if hasattr(self.request.user, "team")
else groups(org),
)
posthoganalytics.group_identify(
"organization",
Expand Down

0 comments on commit 056300f

Please sign in to comment.