def prepare(annotation): """ Prepare the given annotation for indexing. Scan the passed annotation for any target URIs or document metadata URIs and add normalized versions of these to the document. """ groups.set_group_if_reply(annotation) groups.set_permissions(annotation) # FIXME: When this becomes simply part of a search indexing operation, this # should probably not mutate its argument. _normalize_annotation_target_uris(annotation) _copy_parent_scopes_into_replies(annotation) if 'user' in annotation and nipsa.has_nipsa(annotation['user']): annotation['nipsa'] = True
def prepare(annotation): """ Prepare the given annotation for indexing. Scan the passed annotation for any target URIs or document metadata URIs and add normalized versions of these to the document. """ groups.set_group_if_reply(annotation) groups.insert_group_if_none(annotation) groups.set_permissions(annotation) # FIXME: Remove this in a month or so, when all our clients have been # updated. -N 2015-09-25 _transform_old_style_comments(annotation) # FIXME: When this becomes simply part of a search indexing operation, this # should probably not mutate its argument. _normalize_annotation_target_uris(annotation) if 'user' in annotation and nipsa.has_nipsa(annotation['user']): annotation['nipsa'] = True