# HG changeset patch # User Pierre-Yves David # Date 1366889702 -7200 # Node ID 4ae4242bceb1e7064292df1d51e5bf6e5eba5062 # Parent 4b195bd82e8bdf4d3cdaf48bbfedeb35ceeea911 [notification] merge BaseNotificationView and NotificationView They are in the same module now. diff -r 4b195bd82e8b -r 4ae4242bceb1 sobjects/notification.py --- a/sobjects/notification.py Thu Apr 25 13:34:48 2013 +0200 +++ b/sobjects/notification.py Thu Apr 25 13:35:02 2013 +0200 @@ -65,12 +65,10 @@ """raise this if you decide to skip an email during its generation""" -class BaseNotificationView(EntityView): +class NotificationView(EntityView): """abstract view implementing the "email" API (eg to simplify sending notification) """ - __abstract__ = True - # XXX refactor this class to work with len(rset) > 1 msgid_timestamp = True @@ -162,9 +160,8 @@ self._cw.vreg.config.sendmails([(msg, recipients)]) def send_on_commit(self, recipients, msg): - raise NotImplementedError - - send = send_now + SendMailOp(self._cw, recipients=recipients, msg=msg) + send = send_on_commit # email generation helpers ################################################# @@ -200,15 +197,6 @@ return kwargs -class NotificationView(BaseNotificationView): - """overriden to delay actual sending of mails to a commit operation by - default - """ - def send_on_commit(self, recipients, msg): - SendMailOp(self._cw, recipients=recipients, msg=msg) - send = send_on_commit - - class StatusChangeMixIn(object): __regid__ = 'notif_status_change' msgid_timestamp = True