Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #8
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)
Пример #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)
Пример #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)
Пример #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)
Пример #12
0
def on_user_starred_dataset(dataset):
    write_activity.delay(UserStarredDataset, current_user._get_current_object(), dataset=dataset)
Пример #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)
Пример #14
0
def on_user_created_organization(organization):
    user = current_user._get_current_object()
    write_activity.delay(UserCreatedOrganization, user, organization, organization=organization)
Пример #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)
Пример #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)
Пример #17
0
def on_user_starred_org(organization):
    write_activity.delay(UserStarredOrganization, current_user._get_current_object(), organization=organization)
Пример #18
0
def on_user_starred_reuse(reuse):
    write_activity.delay(UserStarredReuse, current_user._get_current_object(), reuse=reuse)