diff --git a/views.py b/views.py index ea019423d4ea5b8732ae51befe058c3337311850_dmlld3MucHk=..7e2c2fbbe84157815baae7521e110c1636144645_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -16,7 +16,7 @@ from cubicweb.selectors import (one_line_rset, but_etype, implements, has_permission, relation_possible, yes, - match_kwargs, rql_condition) + match_kwargs, score_entity) from cubicweb.view import EntityView from cubicweb.common.uilib import rql_for_eid, cut, safe_cut from cubicweb.common.mixins import TreeViewMixIn @@ -318,8 +318,8 @@ class DelteCommentAction(Action): id = 'delete_comment' - __select__ = implements('Comment') & has_permission('delete') \ - & rql_condition('NOT EXISTS(C comments X)') + __select__ = implements('Comment') & \ + score_entity(lambda x: not x.reverse_comments and x.has_perm('delete')) title = _('delete comment') category = 'hidden'