Skip to content
Snippets Groups Projects
Commit b0b42cfa25e3 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

use is_in_state to avoid spurious possible views error (needs cw 3.7.3)

parent 4b93c8ae5ea2
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
] ]
__depends_cubes__ = {} __depends_cubes__ = {}
__depends__ = {'cubicweb': '>= 3.6.0'} __depends__ = {'cubicweb': '>= 3.7.3'}
__use__ = tuple(__depends_cubes__) __use__ = tuple(__depends_cubes__)
# package ### # package ###
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Architecture: all Architecture: all
Conflicts: erudi-blog, erudi-blog-server, erudi-blog-client, erudi-blog-comp Conflicts: erudi-blog, erudi-blog-server, erudi-blog-client, erudi-blog-comp
Replaces: 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 Description: blog component for the CubicWeb framework
This CubicWeb component provides blogging functionnalities. This CubicWeb component provides blogging functionnalities.
. .
......
from cubicweb.selectors import implements, score_entity from cubicweb.selectors import implements, is_in_state
from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn
class BlogEntryPublishedView(StatusChangeMixIn, NotificationView): class BlogEntryPublishedView(StatusChangeMixIn, NotificationView):
"""get notified from published blogs""" """get notified from published blogs"""
...@@ -2,10 +2,8 @@ ...@@ -2,10 +2,8 @@
from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn from cubicweb.sobjects.notification import NotificationView, StatusChangeMixIn
class BlogEntryPublishedView(StatusChangeMixIn, NotificationView): class BlogEntryPublishedView(StatusChangeMixIn, NotificationView):
"""get notified from published blogs""" """get notified from published blogs"""
__select__ = (implements('BlogEntry',) __select__ = implements('BlogEntry',) & is_in_state('published')
& score_entity(lambda x: x.latest_trinfo().new_state.name == 'published')
)
content_attr = 'content' content_attr = 'content'
def subject(self): def subject(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment