예제 #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)))
예제 #2
0
파일: listeners.py 프로젝트: atelic/osf.io
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)))
예제 #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)))
예제 #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)))
예제 #5
0
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)))
예제 #6
0
파일: listeners.py 프로젝트: atelic/osf.io
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)))