Exemplo n.º 1
0
def user_status_updated(view, status_update):
    event_name = 'user_status_updated'
    event_kwargs = dict(
        distinct_id=status_update.author.profile.get_uuid(),
        event_name=event_name,
        applicant_uuid=status_update.application.form_submission.get_uuid(),
        application_id=status_update.application.id,
        status_type=status_update.status_type.display_name,
        next_steps=[
            step.display_name for step in status_update.next_steps.all()
        ],
        additional_info_length=len(status_update.additional_information),
        other_next_steps_length=len(status_update.other_next_step),
        message_change_ratio=SNService.get_message_change_ratio(status_update),
        contact_info_keys=SNService.get_contact_info_keys(status_update),
        has_unsent_additional_info=SNService.has_unsent_additional_info(
            status_update),
        has_unsent_other_next_step=SNService.has_unsent_other_next_step(
            status_update),
        **mixpanel_applicant_data(
            status_update.application.form_submission.applicant),
        **mixpanel_data_from_view_request_user(view))
    if hasattr(status_update, 'notification'):
        event_kwargs.update(notification_contact_info_types=list(
            status_update.notification.contact_info.keys()))
    log_to_mixpanel(**event_kwargs)
Exemplo n.º 2
0
def user_status_updated(view, status_update):
    event_name = 'user_status_updated'
    event_kwargs = dict(
        distinct_id=status_update.author.profile.get_uuid(),
        event_name=event_name,
        applicant_uuid=status_update.application.form_submission.get_uuid(),
        application_id=status_update.application.id,
        status_type=status_update.status_type.display_name,
        next_steps=[
            step.display_name for step in status_update.next_steps.all()],
        additional_info_length=len(status_update.additional_information),
        other_next_steps_length=len(status_update.other_next_step),
        message_change_ratio=SNService.get_message_change_ratio(status_update),
        contact_info_keys=SNService.get_contact_info_keys(status_update),
        has_unsent_additional_info=SNService.has_unsent_additional_info(
            status_update),
        has_unsent_other_next_step=SNService.has_unsent_other_next_step(
            status_update),
        **mixpanel_applicant_data(
            status_update.application.form_submission.applicant),
        **mixpanel_data_from_view_request_user(view))
    if hasattr(status_update, 'notification'):
        event_kwargs.update(
            notification_contact_info_types=list(
                status_update.notification.contact_info.keys()))
    log_to_mixpanel(**event_kwargs)
Exemplo n.º 3
0
def status_updated(status_update):
    event_name = 'app_status_updated'
    event_kwargs = dict(
        distinct_id=status_update.application.form_submission.get_uuid(),
        event_name=event_name,
        user_email=status_update.author.email,
        application_id=status_update.application.id,
        status_type=status_update.status_type.display_name,
        next_steps=[
            step.display_name for step in status_update.next_steps.all()],
        additional_info_length=len(status_update.additional_information),
        other_next_steps_length=len(status_update.other_next_step),
        organization_name=status_update.author.profile.organization.name,
        message_change_ratio=SNService.get_message_change_ratio(status_update),
        contact_info_keys=SNService.get_contact_info_keys(status_update),
        has_unsent_additional_info=SNService.has_unsent_additional_info(
            status_update),
        has_unsent_other_next_step=SNService.has_unsent_other_next_step(
            status_update),
        )
    if hasattr(status_update, 'notification'):
        event_kwargs.update(
            notification_contact_info_types=list(
                status_update.notification.contact_info.keys()))
    log_to_mixpanel.delay(**event_kwargs)
Exemplo n.º 4
0
def status_updated(status_update):
    event_name = 'app_status_updated'
    event_kwargs = dict(
        distinct_id=status_update.application.form_submission.get_uuid(),
        event_name=event_name,
        user_email=status_update.author.email,
        application_id=status_update.application.id,
        status_type=status_update.status_type.display_name,
        next_steps=[
            step.display_name for step in status_update.next_steps.all()
        ],
        additional_info_length=len(status_update.additional_information),
        other_next_steps_length=len(status_update.other_next_step),
        organization_name=status_update.author.profile.organization.name,
        message_change_ratio=SNService.get_message_change_ratio(status_update),
        contact_info_keys=SNService.get_contact_info_keys(status_update),
        has_unsent_additional_info=SNService.has_unsent_additional_info(
            status_update),
        has_unsent_other_next_step=SNService.has_unsent_other_next_step(
            status_update),
    )
    if hasattr(status_update, 'notification'):
        event_kwargs.update(notification_contact_info_types=list(
            status_update.notification.contact_info.keys()))
    log_to_mixpanel.delay(**event_kwargs)