from __future__ import print_function, absolute_import

from sentry import analytics
from sentry.signals import join_request_created, join_request_link_viewed


@join_request_created.connect(weak=False)
def record_join_request_created(member, **kwargs):
    analytics.record(
        "join_request.created", member_id=member.id, organization_id=member.organization_id
    )


@join_request_link_viewed.connect(weak=False)
def record_join_request_link_viewed(organization, **kwargs):
    analytics.record("join_request.link_viewed", organization_id=organization.id)

[((162, 202), 'sentry.signals.join_request_created.connect', 'join_request_created.connect', ([], {'weak': '(False)'}), '(weak=False)\n', (190, 202), False, 'from sentry.signals import join_request_created, join_request_link_viewed\n'), ((377, 421), 'sentry.signals.join_request_link_viewed.connect', 'join_request_link_viewed.connect', ([], {'weak': '(False)'}), '(weak=False)\n', (409, 421), False, 'from sentry.signals import join_request_created, join_request_link_viewed\n'), ((258, 363), 'sentry.analytics.record', 'analytics.record', (['"""join_request.created"""'], {'member_id': 'member.id', 'organization_id': 'member.organization_id'}), "('join_request.created', member_id=member.id,\n    organization_id=member.organization_id)\n", (274, 363), False, 'from sentry import analytics\n'), ((487, 564), 'sentry.analytics.record', 'analytics.record', (['"""join_request.link_viewed"""'], {'organization_id': 'organization.id'}), "('join_request.link_viewed', organization_id=organization.id)\n", (503, 564), False, 'from sentry import analytics\n')]