Exemplo n.º 1
0
    # Sourcemaps
    if has_sourcemap(event):
        feature_slugs.append("source_maps")

    # Breadcrumbs
    if event.data.get("breadcrumbs"):
        feature_slugs.append("breadcrumbs")

    if not feature_slugs:
        return

    FeatureAdoption.objects.bulk_record(project.organization_id, feature_slugs)


event_processed.connect(record_event_processed, weak=False)
transaction_processed.connect(record_event_processed, weak=False)


@user_feedback_received.connect(weak=False)
def record_user_feedback(project, **kwargs):
    FeatureAdoption.objects.record(organization_id=project.organization_id,
                                   feature_slug="user_feedback",
                                   complete=True)


@project_created.connect(weak=False)
def record_project_created(project, user, **kwargs):
    FeatureAdoption.objects.record(organization_id=project.organization_id,
                                   feature_slug="first_project",
                                   complete=True)
Exemplo n.º 2
0
            logging.getLogger("sentry").warning(
                "Cannot record release received for organization (%s) due to missing owners",
                project.organization_id,
            )
            return

        analytics.record(
            "first_release_tag.sent",
            user_id=user.id,
            project_id=project.id,
            organization_id=project.organization_id,
        )
        try_mark_onboarding_complete(project.organization_id)


event_processed.connect(record_release_received, weak=False)
transaction_processed.connect(record_release_received, weak=False)


def record_user_context_received(project, event, **kwargs):
    user_context = event.data.get("user")
    if not user_context:
        return
    # checking to see if only ip address is being sent (our js library does this automatically)
    # testing for this in test_no_user_tracking_for_ip_address_only
    # list(d.keys()) pattern is to make this python3 safe
    elif list(user_context.keys()) != ["ip_address"]:
        success = OrganizationOnboardingTask.objects.record(
            organization_id=project.organization_id,
            task=OnboardingTask.USER_CONTEXT,
            status=OnboardingTaskStatus.COMPLETE,