cubicweb/hooks/test/data/hooks.py
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Mon, 29 Oct 2018 10:04:31 +0100
branch3.26
changeset 12432 2fcb53ee5178
parent 11129 97095348b3ee
permissions -rw-r--r--
Fix flake8 issues since release 3.6.0 Flake8 had a new release which raise new issues, namely: W504: line break after binary operator F841: local variable 'ex' is assigned to but never used W605: invalid escape sequence F821: undefined name 'buffer' (noqa seems the only way to avoid this false positive) Also pin flake8>=3.6 in our tests and make explicit that we use python3 to run flake8 tests.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11084
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     1
from cubicweb.predicates import is_instance
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     2
from cubicweb.hooks import notification
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     3
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     4
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     5
class FolderUpdateHook(notification.EntityUpdateHook):
12432
2fcb53ee5178 Fix flake8 issues since release 3.6.0
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents: 11129
diff changeset
     6
    __select__ = (notification.EntityUpdateHook.__select__
2fcb53ee5178 Fix flake8 issues since release 3.6.0
Philippe Pepiot <philippe.pepiot@logilab.fr>
parents: 11129
diff changeset
     7
                  & is_instance('Folder'))
11084
ffd615e626f9 [hooks] Skip modification_date attribute in "notifentityupdated" hook
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
diff changeset
     8
    order = 100  # late trigger so that metadata hooks come before.