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)
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)
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)
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)
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)
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)
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)
def on_user_deleted_dataset(dataset): user = current_user._get_current_object() organization = dataset.organization write_activity.delay(UserDeletedDataset, user, organization, dataset=dataset)
def on_user_starred_dataset(dataset): write_activity.delay(UserStarredDataset, current_user._get_current_object(), dataset=dataset)
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)
def on_user_created_organization(organization): user = current_user._get_current_object() write_activity.delay(UserCreatedOrganization, user, organization, organization=organization)
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)
def on_user_deleted_reuse(reuse): user = current_user._get_current_object() organization = reuse.organization write_activity.delay(UserDeletedReuse, user, organization, reuse=reuse)
def on_user_starred_org(organization): write_activity.delay(UserStarredOrganization, current_user._get_current_object(), organization=organization)
def on_user_starred_reuse(reuse): write_activity.delay(UserStarredReuse, current_user._get_current_object(), reuse=reuse)