Esempio n. 1
0
def on_user_updated_organization(organization):
    if current_user and current_user.is_authenticated:
        user = current_user._get_current_object()
        write_activity.delay(UserUpdatedOrganization,
                             user,
                             organization,
                             organization=organization)
Esempio n. 2
0
def write_activity_on_discuss(discussion, **kwargs):
    if current_user.is_authenticated:
        if isinstance(discussion.subject, Dataset):
            write_activity.delay(
                UserDiscussedDataset, current_user._get_current_object(),
                discussion.subject)
        elif isinstance(discussion.subject, Reuse):
            write_activity.delay(
                UserDiscussedReuse, current_user._get_current_object(),
                discussion.subject)
Esempio n. 3
0
def write_activity_on_discuss(discussion, **kwargs):
    if current_user.is_authenticated():
        if isinstance(discussion.subject, Dataset):
            write_activity.delay(
                UserDiscussedDataset, current_user._get_current_object(),
                discussion.subject)
        elif isinstance(discussion.subject, Reuse):
            write_activity.delay(
                UserDiscussedReuse, current_user._get_current_object(),
                discussion.subject)
Esempio n. 4
0
def write_activity_on_follow(follow, **kwargs):
    if current_user.is_authenticated:
        if isinstance(follow.following, Dataset):
            write_activity.delay(UserFollowedDataset, current_user._get_current_object(), follow.following)
        elif isinstance(follow.following, Reuse):
            write_activity.delay(UserFollowedReuse, current_user._get_current_object(), follow.following)
        elif isinstance(follow.following, Organization):
            write_activity.delay(UserFollowedOrganization, current_user._get_current_object(), follow.following)
        elif isinstance(follow.following, User):
            write_activity.delay(UserFollowedUser, current_user._get_current_object(), follow.following)
Esempio n. 5
0
def write_activity_on_follow(follow, **kwargs):
    if current_user.is_authenticated:
        if isinstance(follow.following, Dataset):
            write_activity.delay(
                UserFollowedDataset, current_user._get_current_object(),
                follow.following)
        elif isinstance(follow.following, Reuse):
            write_activity.delay(
                UserFollowedReuse, current_user._get_current_object(),
                follow.following)
        elif isinstance(follow.following, Organization):
            write_activity.delay(
                UserFollowedOrganization, current_user._get_current_object(),
                follow.following)
        elif isinstance(follow.following, User):
            write_activity.delay(
                UserFollowedUser, current_user._get_current_object(),
                follow.following)
Esempio n. 6
0
def on_user_deleted_dataset(dataset):
    if (not dataset.private and current_user and
            current_user.is_authenticated):
        user = current_user._get_current_object()
        organization = dataset.organization
        write_activity.delay(UserDeletedDataset, user, dataset, organization)
Esempio n. 7
0
def on_user_deleted_dataset(dataset):
    if (not dataset.private and current_user and
            current_user.is_authenticated):
        user = current_user._get_current_object()
        organization = dataset.organization
        write_activity.delay(UserDeletedDataset, user, dataset, organization)
def on_user_deleted_reuse(reuse):
    if not reuse.private and current_user and current_user.is_authenticated:
        user = current_user._get_current_object()
        organization = reuse.organization
        write_activity.delay(UserDeletedReuse, user, reuse, organization)
Esempio n. 9
0
def on_user_deleted_reuse(reuse):
    if not reuse.private and current_user and current_user.is_authenticated():
        user = current_user._get_current_object()
        organization = reuse.organization
        write_activity.delay(UserDeletedReuse, user, reuse, organization)
Esempio n. 10
0
def on_user_updated_organization(organization):
    if current_user and current_user.is_authenticated:
        user = current_user._get_current_object()
        write_activity.delay(UserUpdatedOrganization, user, organization, organization=organization)
Esempio n. 11
0
def on_user_deleted_dataset(dataset):
    user = current_user._get_current_object()
    organization = dataset.organization
    write_activity.delay(UserDeletedDataset, user, organization, dataset=dataset)
Esempio n. 12
0
def on_user_starred_dataset(dataset):
    write_activity.delay(UserStarredDataset, current_user._get_current_object(), dataset=dataset)
Esempio n. 13
0
def on_user_updated_reuse(reuse):
    if not reuse.private:
        user = current_user._get_current_object()
        organization = reuse.organization
        write_activity.delay(UserUpdatedReuse, user, reuse, organization)
Esempio n. 14
0
def on_user_created_organization(organization):
    user = current_user._get_current_object()
    write_activity.delay(UserCreatedOrganization, user, organization, organization=organization)
Esempio n. 15
0
def on_user_updated_dataset(dataset):
    if not dataset.private:
        user = current_user._get_current_object()
        organization = dataset.organization
        write_activity.delay(UserUpdatedDataset, user, dataset, organization)
Esempio n. 16
0
def on_user_deleted_reuse(reuse):
    user = current_user._get_current_object()
    organization = reuse.organization
    write_activity.delay(UserDeletedReuse, user, organization, reuse=reuse)
Esempio n. 17
0
def on_user_starred_org(organization):
    write_activity.delay(UserStarredOrganization, current_user._get_current_object(), organization=organization)
Esempio n. 18
0
def on_user_starred_reuse(reuse):
    write_activity.delay(UserStarredReuse, current_user._get_current_object(), reuse=reuse)