hooks/notification.py
changeset 3163 edfe43ceaa35
parent 3072 6fb42c53f6df
child 3376 f5c69485381f
equal deleted inserted replaced
3090:8184bec7414d 3163:edfe43ceaa35
    96     __id__ = 'supervising'
    96     __id__ = 'supervising'
    97     events = ('before_add_relation', 'before_delete_relation',
    97     events = ('before_add_relation', 'before_delete_relation',
    98               'after_add_entity', 'before_update_entity')
    98               'after_add_entity', 'before_update_entity')
    99 
    99 
   100     def __call__(self):
   100     def __call__(self):
       
   101         # XXX use proper selectors
       
   102         if self._cw.is_super_session or self._cw.repo.config.repairing:
       
   103             return # ignore changes triggered by hooks or maintainance shell
   101         dest = self._cw.vreg.config['supervising-addrs']
   104         dest = self._cw.vreg.config['supervising-addrs']
   102         if not dest: # no supervisors, don't do this for nothing...
   105         if not dest: # no supervisors, don't do this for nothing...
   103             return
   106             return
   104         if self._call():
   107         if self._call():
   105             SupervisionMailOp(self._cw)
   108             SupervisionMailOp(self._cw)