diff rhodecode/model/notification.py @ 3781:40d50bb7cf2f beta

emailing: log failing emailing as an error TODO: The failure should be reported back to the user (or the admins). The system should not silently not send any emails to the targeted recipients. Even better: it should inform the user whenever emails was (scheduled to be) sent - and to whom.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 10 Apr 2013 03:00:38 +0200
parents ec6354949623
children ffd45b185016
line wrap: on
line diff
--- a/rhodecode/model/notification.py	Thu Apr 04 12:12:38 2013 +0200
+++ b/rhodecode/model/notification.py	Wed Apr 10 03:00:38 2013 +0200
@@ -85,6 +85,9 @@
                 obj = self._get_user(u)
                 if obj:
                     recipients_objs.append(obj)
+                else:
+                    # TODO: inform user that requested operation couldn't be completed
+                    log.error('cannot email unknown user %r', u)
             recipients_objs = set(recipients_objs)
             log.debug('sending notifications %s to %s' % (
                 type_, recipients_objs)
@@ -95,6 +98,7 @@
             log.debug('sending notifications %s to admins: %s' % (
                 type_, recipients_objs)
             )
+        # TODO: inform user who are notified
         notif = Notification.create(
             created_by=created_by_obj, subject=subject,
             body=body, recipients=recipients_objs, type_=type_