def _add_modal(self, explanations, process, soup, tag, context, request):
        context_oid = get_oid(context)
        dace_ui_api = get_current_registry().getUtility(IDaceUIAPI,
        	                                            'dace_ui_api')
        explanationitemaction = None
        explanationitem_actions = process.get_actions('explanationitem')
        if explanationitem_actions:
            explanationitemaction = explanationitem_actions[0]

        if explanationitemaction:
            values = {'url': request.resource_url(context, '@@explanationjson', 
                                            query={'op': 'getform',
                                                   'itemid': tag['data-item']}),
                     'item': explanations[tag['data-item']],
                     }
            body = renderers.render(self.explanation_template, values, request)
            explanation_item_soup = BeautifulSoup(body)
            actionurl_update = dace_ui_api.updateaction_viewurl(
                                request=request,
                                action_uid=str(get_oid(explanationitemaction)),
                                context_uid=str(context_oid))
            values = {'url': actionurl_update,
                     'item': explanations[tag['data-item']],
                    }
            modal_body = renderers.render(self.modal_template, values, request)
            explanation_item_modal_soup = BeautifulSoup(modal_body)
            soup.body.append(explanation_item_modal_soup.body)
            tag.append(explanation_item_soup.body)
            tag.body.unwrap()
Exemple #2
0
def serialize_roles(roles, root=None):
    result = []
    principal_root = getSite()
    if principal_root is None:
        return []

    if root is None:
        root = principal_root

    root_oid = str(get_oid(root, ''))
    principal_root_oid = str(get_oid(principal_root, ''))
    for role in roles:
        if isinstance(role, tuple):
            obj_oid = str(get_oid(role[1], ''))
            result.append((role[0]+'_'+obj_oid).lower())
            superiors = getattr(DACE_ROLES.get(role[0], _marker),
                                'all_superiors', [])
            result.extend([(r.name+'_'+obj_oid).lower()
                           for r in superiors])
        else:
            result.append(role.lower()+'_'+root_oid)
            superiors = getattr(DACE_ROLES.get(role, _marker),
                                'all_superiors', [])
            result.extend([(r.name+'_'+root_oid).lower() for r in
                           superiors])

        for superior in superiors:
            if superior.name == 'Admin':
                result.append('admin_'+principal_root_oid)
                break

    return list(set(result))
Exemple #3
0
    def serialize(self, field, cstruct, **kw):
        if cstruct in (null, None):
            cstruct = ()

        is_multiple = getattr(self, 'multiple', False)
        if is_multiple and not isinstance(cstruct, (list, tuple, set)):
            cstruct = [cstruct]

        if cstruct and is_multiple and \
           not isinstance(list(cstruct)[0], string_types):
            try:
                cstruct = [str(get_oid(value)) for value in cstruct]
            except Exception:
                pass
        elif isinstance(cstruct, string_types):
            try:
                cstruct = str(get_oid(cstruct))
            except Exception:
                pass

        readonly = kw.get('readonly', self.readonly)
        values = kw.get('values', self.values)
        kw['values'] = _normalize_choices(values)
        template = readonly and self.readonly_template or self.template
        tmpl_values = self.get_template_values(field, cstruct, kw)
        return field.renderer(template, **tmpl_values)
Exemple #4
0
    def start(self, context, request, appstruct, **kw):
        appstruct.pop('_csrf_token_')
        user = request.user
        appstruct['user'] = '******'
        if user:
            appstruct['user'] = get_oid(user)

        now = datetime.datetime.now(tz=pytz.timezone('Europe/Paris'))
        appstruct['date'] = now.isoformat()
        site = get_site_folder(True, request)
        appstruct['site'] = get_oid(site)
        alert('arango', [], ["lac."+appstruct['id']], appstruct)
        #alert slack
        appstruct['date'] = to_localized_time(
            now, translate=True)
        text = 'Aimez-vous la nouvelle version: {new_version}\n '
        if appstruct['new_version'] == 'False':
            text += 'Pourquoi non: {explanation}\n '

        text += 'Aimeriez-vous une application mobile: {mobile_application}\n \n User: {user}\n Email: {email}\n Date: {date}'
        text = text.format(**appstruct)
        alert('slack', [], ['questionnaire'], {'text': text})
        if user and not getattr(user, 'email', ''):
            user.email = appstruct.get('email', '')

        return {}
Exemple #5
0
    def start(self, context, request, appstruct, **kw):
        appstruct.pop('_csrf_token_')
        site = get_site_folder(True, request)
        contacts = [c for c in getattr(site, 'contacts', [])
                    if c.get('email', None)]
        if contacts:
            subject = "Avis d'un utilisateur"
            mail = appstruct.get('improvement')
            sender = appstruct.get('email')
            alert('email', [sender], [contacts[-1].get('email')],
                  {'subject': subject, 'body': mail})

        user = request.user
        appstruct['user'] = '******'
        if user:
            appstruct['user'] = get_oid(user)

        now = datetime.datetime.now(tz=pytz.timezone('Europe/Paris'))
        appstruct['date'] = now.isoformat()
        appstruct['site'] = get_oid(site)
        alert('arango', [], ["lac."+appstruct['id']], appstruct)
        #alert slack
        appstruct['date'] = to_localized_time(
            now, translate=True)
        text = '{improvement}\n User: {user}\n URL: {url}\n Email: {email}\n Date: {date}'.format(**appstruct)
        alert('slack', [], ['improve'], {'text': text})
        if user and not getattr(user, 'email', ''):
            user.email = appstruct.get('email', '')

        return {}
Exemple #6
0
def clean_reviews(root, registry):
    import json
    from substanced.util import get_oid
    from dace.util import find_catalog

    wapis = [s for s in root.site_folders if s.title == 'Sortir Wapi']
    lilles = [s for s in root.site_folders if s.title == 'Sortir Lille']
    wapi_site = wapis[0]
    wapi_site_oid = get_oid(wapi_site)
    lille_site = lilles[0]
    lille_site_oid = get_oid(lille_site)
    with open('critiques.json') as data_file:
        entities = json.load(data_file)
        entities_with_ids = [entity for entity in entities
                             if entity.get('source_data', {}).get('id', None)]
        ids = {str(entity['source_data']['id'] + '_' + entity['source_data']['source_id']): entity
               for entity in entities_with_ids}
        lac_catalog = find_catalog('lac')
        object_id_index = lac_catalog['object_id']
        reviews = object_id_index.any(list(ids.keys())).execute()
        len_entities = str(len(reviews))
        for index, review in enumerate(reviews):
            reviwe_site = getattr(review, 'source_data', {}).get('site', None)
            if reviwe_site != 'wapi':
                review.access_control = PersistentList(
                    [wapi_site_oid, lille_site_oid])
                review.reindex()
                log.info("Wapi-Lille: "+str(index) + "/" + len_entities)
            else:
                log.info("Wapi: "+str(index) + "/" + len_entities)

    log.info('Clean review evolved.')
Exemple #7
0
    def start(self, context, request, appstruct, **kw):
        subject = appstruct.get('subject')
        mail = appstruct.get('message')
        sender = appstruct.get('email')
        services = appstruct.get('services')
        alert('email', [sender], list(services),
              {'subject': subject, 'body': mail})
        appstruct.pop('_csrf_token_')
        user = request.user
        appstruct['user'] = '******'
        if user:
            appstruct['user'] = get_oid(user)

        now = datetime.datetime.now(tz=pytz.timezone('Europe/Paris'))
        appstruct['date'] = now.isoformat()
        appstruct['services'] = str(appstruct['services'])
        site = get_site_folder(True, request)
        appstruct['site'] = get_oid(site)
        alert('arango', [], ["lac.contact"], appstruct)
        #alert slack
        appstruct['date'] = to_localized_time(
            now, translate=True)
        text = 'Sujet: {subject}\n Message: {message}\n User: {user}\n Nom: {name}\n Email: {email}\n Date: {date}\n\n Service: {services}'.format(**appstruct)
        alert('slack', [], ['lac_contact'], {'text': text})
        if user and not getattr(user, 'email', ''):
            user.email = sender

        return {}
Exemple #8
0
def get_roles(user=None, obj=None,
              root=None, ignore_groups=False):
    if user is None:
        user = get_current()

    if isinstance(user, Anonymous):
        return [RoleAnonymous.name]

    if root is None:
        root = getSite()

    if obj is None:
        obj = root

    opts = {u'source_id': get_oid(user),
            u'target_id': get_oid(obj)}
    opts[u'reftype'] = 'Role'
    roles = [r.relation_id for r in find_relations(obj, opts).all()]
    principals = find_service('principals')
    sd_admin = principals['users']['admin']
    if sd_admin is user and 'Admin' not in roles:
        roles.append('Admin')

    groups = []
    if not ignore_groups:
        groups.extend(getattr(user, 'user_groups', []))

    for group in groups:
        roles.extend(get_roles(group, obj, root))

    return list(set(roles))
    def update(self):
        result = {}
        duplicates = get_duplicates(self.context)
        diff_bodies = {}
        context_view = self.content(
            args={'object': self.context},
            template=self.context.templates.get('diff', None))['body']

        for duplicate in duplicates:
            duplicate_view = self.content(
                args={'object': duplicate},
                template=duplicate.templates.get('diff', None))['body']
            soupt, textdiff = html_diff_wrapper.render_html_diff(
                context_view, duplicate_view)
            diff_bodies[duplicate] = (textdiff, get_oid(duplicate))

        values = {'context': self.context,
                  'oid': get_oid(self.context),
                  'context_view': context_view,
                  'contents': diff_bodies,
                  'view': self}
        body = self.content(args=values, template=self.template)['body']
        item = self.adapt_item(body, self.viewid)
        result['coordinates'] = {self.coordinates: [item]}
        return result
    def update(self):
        result = {}
        site = get_site_folder(True, self.request)
        user = get_current(self.request)
        is_manager = has_any_roles(
            user=user,
            roles=('Admin', ('SiteAdmin', site))) or\
            is_site_moderator(self.request)
        duplicates = find_duplicates_artist(self.context, self.duplicates_state)
        diff_bodies = {}
        context_view = self.content(
            args={'object': self.context},
            template=self.context.templates.get('diff', None))['body']

        for duplicate in duplicates:
            duplicate_view = self.content(
                args={'object': duplicate},
                template=duplicate.templates.get('diff', None))['body']
            soupt, textdiff = html_diff_wrapper.render_html_diff(
                context_view, duplicate_view)
            diff_bodies[duplicate] = (textdiff, get_oid(duplicate))

        values = {'context': self.context,
                  'oid': get_oid(self.context),
                  'context_view': context_view,
                  'contents': diff_bodies,
                  'row_len': math.ceil(len(diff_bodies)/2),
                  'is_manager': is_manager,
                  'view': self}
        body = self.content(args=values, template=self.template)['body']
        item = self.adapt_item(body, self.viewid)
        result['coordinates'] = {self.coordinates: [item]}
        return result
Exemple #11
0
def get_access_keys(user, root=None, to_exclude=[]):
    if isinstance(user, Anonymous):
        return ['anonymous']

    principals = find_service('principals')
    sd_admin = principals['users']['admin']
    pricipal_root = getSite()
    if root is None:
        root = pricipal_root

    root_oid = get_oid(root)
    principal_root_oid = get_oid(pricipal_root)
    if sd_admin is user:
        return list(set([('admin'+'_'+str(root_oid)).lower(),
                ('admin'+'_'+str(principal_root_oid)).lower()]))

    groups = list(getattr(user, 'user_groups', []))
    groups.append(user)
    relations = []
    for group in groups:
        opts = {u'source_id': get_oid(group)}
        opts[u'reftype'] = 'Role'
        relations.extend(list(find_relations(group, opts).all()))

    result = [(t.relation_id+'_'+str(t.target_id)).lower() \
              for t in relations if t.target_id not in to_exclude]
    for relation in relations:
        if relation.relation_id == 'Admin':
            result.append(('admin'+'_'+str(principal_root_oid)).lower())
            break

    return list(set(result))
Exemple #12
0
 def bind(self):
     bindings = {}
     user = get_current(self.request)
     dace_catalog = find_catalog('dace')
     novaideo_catalog = find_catalog('novaideo')
     object_authors_index = novaideo_catalog['object_authors']
     container_index = dace_catalog['container_oid']
     query = container_index.eq(get_oid(self.context))
     objects = find_entities(
         interfaces=[IAmendment],
         user=user,
         add_query=query)
     query = query & object_authors_index.any([get_oid(user)])
     my_objs = find_entities(
         interfaces=[IAmendment],
         user=user,
         add_query=query)
     len_result = len(objects)
     len_my = len(my_objs)
     len_others = len_result - len_my
     bindings['user'] = user
     bindings['len_result'] = len_result
     bindings['len_my'] = len_my
     bindings['len_others'] = len_others
     setattr(self, '_bindings', bindings)
Exemple #13
0
 def _get_query(self, user):
     dace_catalog = find_catalog('dace')
     novaideo_catalog = find_catalog('novaideo')
     object_authors_index = novaideo_catalog['object_authors']
     container_index = dace_catalog['container_oid']
     return container_index.eq(get_oid(self.context)) & \
         object_authors_index.notany([get_oid(user)])
Exemple #14
0
def content_added_or_removed(event):
    """ Generates ContentAdded and ContentRemoved audit events """
    if IObjectWillBeRemoved.providedBy(event):
        event_name = 'ContentRemoved'
    elif IObjectAdded.providedBy(event):
        event_name = 'ContentAdded'
    else:
        return False # for testing
    userinfo = get_userinfo()
    eventscribe = AuditScribe(event.object)
    parent = event.parent
    # this is an event related to the *container*, not to the object.
    folder_oid = get_oid(parent, None)
    object_oid = get_oid(event.object, None)
    folder_path = resource_path(parent)
    object_name = event.name
    moving = bool(event.moving)
    loading = bool(event.loading)
    content_type = str(event.registry.content.typeof(event.object))
    eventscribe.add(
        event_name,
        folder_oid,
        object_oid=object_oid,
        folder_oid=folder_oid,
        folder_path=folder_path,
        object_name=object_name,
        content_type=content_type,
        userinfo=userinfo,
        moving=moving,
        loading=loading,
        )
Exemple #15
0
def reviwes_access_control_evolve(root, registry):
    from lac.views.filter import find_entities
    from lac.content.interface import IBaseReview
    from substanced.util import get_oid

    reviews = find_entities(interfaces=[IBaseReview])
    len_entities = str(len(reviews))
    wapis = [s for s in root.site_folders if s.title == 'Sortir Wapi']
    lilles = [s for s in root.site_folders if s.title == 'Sortir Lille']
    wapi_site = wapis[0]
    wapi_site_oid = get_oid(wapi_site)
    lille_site = lilles[0]
    lille_site_oid = get_oid(lille_site)
    for index, review in enumerate(reviews):
        reviwe_site = getattr(review, 'source_data', {}).get('site', None)
        reviwe_siteid = getattr(review, 'source_data', {}).get('source_id', None)
        if reviwe_site == 'wapi':
            review.source_site = wapi_site_oid
            review.access_control = PersistentList([wapi_site_oid])
            log.info("Wapi: "+str(index) + "/" + len_entities)
        elif reviwe_siteid == 'sortir':
            review.source_site = lille_site_oid
            review.access_control = PersistentList([lille_site_oid])
            #log.info("Lille: "+str(index) + "/" + len_entities)
        else:
            source_site = review.source_site if review.source_site else 'all'
            review.access_control = PersistentList([source_site])
            #log.info("CrerationCulturelle: "+str(index) + "/" + len_entities)

        review.reindex()

    log.info('Review access_control evolved.')
Exemple #16
0
    def calculate_votes(self, votes):
        """Return the result of ballot"""

        result = {}
        for subject in self.report.subjects:
            try:
                subject_id = get_oid(subject)
            except Exception:
                subject_id = subject

            result[subject_id] = 0

        for vote in votes:
            subject = get_obj(vote.value)
            if subject is None:
                subject = vote.value

            try:
                subject_id = get_oid(vote.value)
            except Exception:
                subject_id = vote.value
            
            if subject in self.report.subjects:
                result[subject_id] += 1

        return result
Exemple #17
0
    def test_disconnect_relation(self):
        before = len(get_relations_container(self.app))
        source, target, relation = self._create_relation()
        self.assertEqual(len(get_relations_container(source)), before + 1)
        results = find_relations(source, {'target_id': get_oid(target)})

        before = len(get_relations_container(self.app))
        disconnect(relation)
        self.assertEqual(len(get_relations_container(source)), before - 1)
        results = find_relations(source, {'target_id': get_oid(target)})
        self.assertEqual(len(list(results)), 0)
Exemple #18
0
    def test_remove_target(self):
        before = len(get_relations_container(self.app))
        source, target, relation = self._create_relation()
        self.assertEqual(len(get_relations_container(source)), before + 1)
        results = find_relations(source, {'target_id': get_oid(target)})
        self.assertEqual(len(list(results)), 1)

        before = len(get_relations_container(self.app))
        del target.__parent__[target.__name__]
        self.assertEqual(len(get_relations_container(source)), before - 1)
        results = find_relations(source, {'target_id': get_oid(target)})
        self.assertEqual(len(list(results)), 0)
Exemple #19
0
    def start(self, context, request, appstruct, **kw):
        access_control = appstruct['access_control']
        if 'self' in access_control:
            site = get_site_folder(True, request)
            if site:
                access_control = list(access_control)
                access_control.remove('self')
                access_control.append(get_oid(site))

        access_control = [get_oid(obj, obj) for obj in access_control]
        context.access_control = PersistentList(access_control)
        context.reindex()
        return {}
Exemple #20
0
    def all_alerts(self):
        novaideo_catalog = find_catalog('novaideo')
        dace_catalog = find_catalog('dace')
        alert_keys_index = novaideo_catalog['alert_keys']
        alert_exclude_keys_index = novaideo_catalog['alert_exclude_keys']
        object_provides_index = dace_catalog['object_provides']
        exclude = [str(get_oid(self))]
        if self.mask:
            exclude.append(str(get_oid(self.mask)))

        query = object_provides_index.any([IAlert.__identifier__]) & \
            alert_keys_index.any(self.get_alerts_keys()) & \
            alert_exclude_keys_index.notany(exclude)
        return query.execute()
Exemple #21
0
 def setUp(self):
     super(TestVoteIntegration, self).setUp()
     self.user1 = self.root['principals']['users']['user1'] = User()
     self.user2 = self.root['principals']['users']['user2'] = User()
     self.user3 = self.root['principals']['users']['user3'] = User()
     self.user4 = self.root['principals']['users']['user4'] = User()
     self.subject1 = self.root['subject1'] = SubjectType(title='subject1')
     self.subject2 = self.root['subject2'] = SubjectType(title='subject2')
     self.subject3 = self.root['subject3'] = SubjectType(title='subject3')
     self.subject4 = self.root['subject4'] = SubjectType(title='subject4')
     self.oid_subject1 = get_oid(self.subject1)
     self.oid_subject2 = get_oid(self.subject2)
     self.oid_subject3 = get_oid(self.subject3)
     self.oid_subject4 = get_oid(self.subject4)
Exemple #22
0
    def _identify_corrections(self, soup, correction, descriminator, content, user):
        correction_tags = soup.find_all('span', {'id': "correction"})
        correction_oid = str(get_oid(correction))
        user_oid = get_oid(user)
        for correction_tag in correction_tags:
            correction_tag['data-correction'] = correction_oid
            correction_tag['data-item'] = str(descriminator)
            correction_tag['data-content'] = content
            init_vote = {'favour': [user_oid],
                         'against': [], 'content': content}
            correction.corrections[str(descriminator)] = init_vote
            descriminator += 1

        return descriminator
Exemple #23
0
    def action_infomrations(self, action, context, request=None, **args):
        action_id = action.behavior_id
        view_title = action.title
        view = DEFAULTMAPPING_ACTIONS_VIEWS.get(action._class_, None)
        if view:
            view_title = getattr(view, 'title', view_title)

        action_oid = 'start'
        context_oid = get_oid(context)
        try:
            action_oid = get_oid(action)
        except Exception:
            pass

        action_id = action_id + str(action_oid) + '_' + str(context_oid)
        if action_oid == 'start':
            after_url = self.afterexecution_viewurl(
                request=request,
                isstart=True,
                context_uid=str(context_oid),
                pd_id=action.node.process.id,
                action_id=action.node.__name__,
                behavior_id=action.behavior_id)
            actionurl_update = self.updateaction_viewurl(
                request=request,
                isstart=True,
                context_uid=str(context_oid),
                pd_id=action.node.process.id,
                action_id=action.node.__name__,
                behavior_id=action.behavior_id)
        else:
            after_url = self.afterexecution_viewurl(
                request=request,
                action_uid=str(action_oid),
                context_uid=str(context_oid))
            actionurl_update = self.updateaction_viewurl(
                request=request,
                action_uid=str(action_oid),
                context_uid=str(context_oid))

        informations = {}
        informations.update({'action': action,
                             'action_id': action_id,
                             'actionurl_update': actionurl_update,
                             'actionurl_after': after_url,
                             'view_title': view_title
                             })

        return informations
Exemple #24
0
    def get_action_body(
        self, context, request, action,
        add_action_discriminator=False, unwrap=True,
        include_resources=False):
        body = ''
        resources = {
            'css_links': [],
            'js_links': []
        }
        if action is not None:
            view = DEFAULTMAPPING_ACTIONS_VIEWS[action._class_]
            view_instance = view(context, request, behaviors=[action])
            if add_action_discriminator:
                action_oid = get_oid(action)
                view_instance.viewid += str(action_oid)

            if unwrap:
                view_instance.wrapper_template = 'daceui:templates/simple_view_wrapper.pt'

            view_result = view_instance()
            body = ''
            if isinstance(view_result, dict) and 'coordinates' in view_result:
                resources['css_links'] = view_result.get('css_links', [])
                resources['js_links'] = view_result.get('js_links', [])
                body = view_instance.render_item(view_result['coordinates'][view_instance.coordinates][0], 
                                                 view_instance.coordinates, None)
        if include_resources:
            return body, resources

        return body
Exemple #25
0
    def serialize(self, node, appstruct):
        _object = None
        if appstruct is None:
            appstruct = colander.null

        if appstruct is not colander.null and \
            not isinstance(appstruct, (dict, PersistentDict)):
            _object = appstruct
            appstruct = _object.get_data(node)

        result = None
        if not self._is_special_object:
            result = colander.Mapping.serialize(self, node, appstruct)
            if not self.editable or result is colander.null:
                return result
        else:
            if appstruct is colander.null:
                return appstruct

            result = appstruct

        if _object is not None:
            result[OBJECT_OID] = get_oid(_object)

        return result
Exemple #26
0
def logged_in(event):
    context = event.request.context # event.context may be HTTPForbidden
    scribe = _get_scribe(context)
    if scribe is None:
        return
    user_oid = get_oid(event.user, None)
    scribe.add('LoggedIn', None, login=event.login, user_oid=user_oid)
    def find_advertistings(self):
        #TODO frequence
        root = getSite()
        context, is_root = self.get_context(root)
        keywords = []
        if hasattr(context, 'get_all_keywords'):
            keywords = list(context.get_all_keywords())
        else:
            keywords = list(getattr(context, 'keywords', []))

        if not keywords:
            keywords = [ROOT_TREE]

        advertisings = getattr(self.request, 'cache_advertisings', None)
        if advertisings is None:
            site = str(get_oid(self.request.get_site_folder))
            advertisings = find_entities(
                interfaces=[IWebAdvertising],
                keywords=keywords,
                metadata_filter={'states': ['published']},
                other_filter={'sources': [site]},
                force_publication_date=True)
            self.request.cache_advertisings = advertisings

        advertisings = [a for a in advertisings
                        if self.name in getattr(a, 'positions', [])]
        if not is_root:
            advertisings = sorted(
                advertisings,
                key=lambda e:
                    getattr(e, 'tree', {}).get(ROOT_TREE, {}) and 1 or 2)

        return advertisings
def performers_choices(context, request):
    performers = request.virtual_root.get('performers')
    if performers is None:
        return () # fbo dump/load
    values = [(get_oid(performer), name) for name, performer in 
                performers.items()]
    return values
Exemple #29
0
def publish_artist(context, request=None, user=None):
    context.state = PersistentList(['published'])
    context.modified_at = datetime.datetime.now(tz=pytz.UTC)
    context.origin_oid = get_oid(context)
    site = get_site_folder(True, request)
    root = getattr(request, 'root', None) if request else getSite()
    author = getattr(context, 'author', None)
    if author and user is not author:
        alert('internal', [site], [author],
              {'kind': InternalAlertKind.moderation_alert,
               'subjects': [context]})

    original = context.original
    if original:
        replaced = original.replace_by(context)
        if replaced:
            request.registry.notify(ObjectReplaced(
                old_object=original,
                new_object=context
            ))
            author = getattr(original, 'author', None)
            if author and user is not author:
                alert('internal', [site], [author],
                      {'kind': InternalAlertKind.content_alert,
                       'subjects': [context],
                       'alert_kind': 'replaced',
                       'replaced_title': original.title})

            root.delfromproperty('artists', original)

    context.reindex()
Exemple #30
0
 def redirect(self, context, request, **kw):
     person = kw['person']
     headers = remember(request, get_oid(person))
     request.registry.notify(LoggedIn(person.email, person,
                                      context, request))
     return HTTPFound(location=request.resource_url(context),
                      headers=headers)