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 @@
]
__depends_cubes__ = {}
__depends__ = {'cubicweb': '>= 3.6.0'}
__depends__ = {'cubicweb': '>= 3.7.3'}
__use__ = tuple(__depends_cubes__)
# package ###
......
......@@ -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.
.
......
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"""
......@@ -2,10 +2,8 @@
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):
......
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