# HG changeset patch # User Sylvain Thénault <sylvain.thenault@logilab.fr> # Date 1270100294 -7200 # Thu Apr 01 07:38:14 2010 +0200 # Branch stable # Node ID b0b42cfa25e3fd47fab085e3db58b1d5962e7f86 # Parent 4b93c8ae5ea2e379587f0c373efb5583b49d8020 use is_in_state to avoid spurious possible views error (needs cw 3.7.3) diff --git a/__pkginfo__.py b/__pkginfo__.py --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -67,7 +67,7 @@ ] __depends_cubes__ = {} -__depends__ = {'cubicweb': '>= 3.6.0'} +__depends__ = {'cubicweb': '>= 3.7.3'} __use__ = tuple(__depends_cubes__) # package ### diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Architecture: all Conflicts: erudi-blog, erudi-blog-server, erudi-blog-client, erudi-blog-comp Replaces: erudi-blog, erudi-blog-server, erudi-blog-client, erudi-blog-comp -Depends: cubicweb-common (>= 3.6.0) +Depends: cubicweb-common (>= 3.7.3) Description: blog component for the CubicWeb framework This CubicWeb component provides blogging functionnalities. . diff --git a/hooks.py b/hooks.py --- a/hooks.py +++ b/hooks.py @@ -1,11 +1,9 @@ -from cubicweb.selectors import implements, score_entity +from cubicweb.selectors import implements, is_in_state from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn class BlogEntryPublishedView(StatusChangeMixIn, NotificationView): """get notified from published blogs""" - __select__ = (implements('BlogEntry',) - & score_entity(lambda x: x.latest_trinfo().new_state.name == 'published') - ) + __select__ = implements('BlogEntry',) & is_in_state('published') content_attr = 'content' def subject(self):