hooks/test/data/hooks.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 17 Feb 2016 17:20:29 +0100
changeset 11145 d3edefdeddb4
parent 11084 ffd615e626f9
permissions -rw-r--r--
[web/autoform] fix regression introduced by #5758ba784ebd The changes from cset 5758ba784ebd "[autoform] when building inlined-form view for a relation, consider related entities intead of other views" lead to an unexpected 'add new' link on creation of an entity with inlined form for a relation of cardinality 1. To avoid this, we should consider formviews and not existing relations when the entity is being created. Closes #10860258

from cubicweb.predicates import is_instance
from cubicweb.hooks import notification


class FolderUpdateHook(notification.EntityUpdateHook):
    __select__ = (notification.EntityUpdateHook.__select__ &
                  is_instance('Folder'))
    order = 100  # late trigger so that metadata hooks come before.