Exemple #1
0
def subscribe_contributor(node, contributor, auth=None, *args, **kwargs):
    try:
        subscribe_user_to_notifications(node, contributor)
    except InvalidSubscriptionError as err:
        logger.warn('Skipping subscription of user {} to node {}'.format(
            contributor, node._id))
        logger.warn('Reason: {}'.format(str(err)))
Exemple #2
0
def subscribe_creator(node):
    try:
        subscribe_user_to_notifications(node, node.creator)
    except InvalidSubscriptionError as err:
        user = node.creator._id if node.creator else 'None'
        logger.warn('Skipping subscription of user {} to node {}'.format(user, node._id))
        logger.warn('Reason: {}'.format(str(err)))
Exemple #3
0
def subscribe_creator(node):
    try:
        subscribe_user_to_notifications(node, node.creator)
    except InvalidSubscriptionError as err:
        user = node.creator._id if node.creator else 'None'
        logger.warn('Skipping subscription of user {} to node {}'.format(
            user, node._id))
        logger.warn('Reason: {}'.format(str(err)))
Exemple #4
0
def subscribe_creator(node):
    if node.institution_id or node.is_collection or node.is_deleted:
        return None
    try:
        subscribe_user_to_notifications(node, node.creator)
    except InvalidSubscriptionError as err:
        user = node.creator._id if node.creator else 'None'
        logger.warn('Skipping subscription of user {} to node {}'.format(
            user, node._id))
        logger.warn('Reason: {}'.format(str(err)))
def subscribe_group_member(group, node, user, permission, auth, throttle=None):
    try:
        subscribe_user_to_notifications(node, user)
    except InvalidSubscriptionError as err:
        logger.warn('Skipping subscription of user {} to node {}'.format(user, node._id))
        logger.warn('Reason: {}'.format(str(err)))
Exemple #6
0
def subscribe_contributor(node, contributor, auth=None, *args, **kwargs):
    try:
        subscribe_user_to_notifications(node, contributor)
    except InvalidSubscriptionError as err:
        logger.warn('Skipping subscription of user {} to node {}'.format(contributor, node._id))
        logger.warn('Reason: {}'.format(str(err)))