sobjects/notification.py
branchtls-sprint
changeset 781 323656dd85a9
parent 761 6378cd66d69f
child 803 ab8d2282e738
equal deleted inserted replaced
780:5b6c93816871 781:323656dd85a9
    17 
    17 
    18 from logilab.common.textutils import normalize_text
    18 from logilab.common.textutils import normalize_text
    19 from logilab.common.deprecation import class_renamed
    19 from logilab.common.deprecation import class_renamed
    20 
    20 
    21 from cubicweb import RegistryException
    21 from cubicweb import RegistryException
    22 from cubicweb.selectors import implements
    22 from cubicweb.selectors import implements, yes
    23 from cubicweb.common.view import EntityView, Component
    23 from cubicweb.common.view import EntityView, Component
    24 from cubicweb.common.mail import format_mail
    24 from cubicweb.common.mail import format_mail
    25 
    25 
    26 from cubicweb.server.pool import PreCommitOperation
    26 from cubicweb.server.pool import PreCommitOperation
    27 from cubicweb.server.hookhelper import SendMailOp
    27 from cubicweb.server.hookhelper import SendMailOp
    34 
    34 
    35     by default user's with their email set are notified if any, else the default
    35     by default user's with their email set are notified if any, else the default
    36     email addresses specified in the configuration are used
    36     email addresses specified in the configuration are used
    37     """
    37     """
    38     id = 'recipients_finder'
    38     id = 'recipients_finder'
    39     __select__ = implements('Any')
    39     __select__ = yes()
    40     user_rql = ('Any X,E,A WHERE X is EUser, X in_state S, S name "activated",'
    40     user_rql = ('Any X,E,A WHERE X is EUser, X in_state S, S name "activated",'
    41                 'X primary_email E, E address A')
    41                 'X primary_email E, E address A')
    42     
    42     
    43     def recipients(self):
    43     def recipients(self):
    44         mode = self.config['default-recipients-mode']
    44         mode = self.config['default-recipients-mode']