def METHOD_NAME(project, user, obj, event_type, created_datetime, extra_data={}, refresh_totals=True):
    project_id = None if project is None else project.id
    ct = ContentType.objects.get_for_model(obj)
    if settings.CELERY_ENABLED:
        connection.on_commit(lambda: push_to_timelines.delay(project_id,
                                                             user.id,
                                                             ct.app_label,
                                                             ct.model,
                                                             obj.id,
                                                             event_type,
                                                             created_datetime,
                                                             extra_data=extra_data,
                                                             refresh_totals=refresh_totals))
    else:
        push_to_timelines(project_id,
                          user.id,
                          ct.app_label,
                          ct.model,
                          obj.id,
                          event_type,
                          created_datetime,
                          extra_data=extra_data,
                          refresh_totals=refresh_totals)