changeset c3b01bf20274 in modules/notification_email:5.8
details: 
https://hg.tryton.org/modules/notification_email?cmd=changeset&node=c3b01bf20274
description:
        Do not migrate log without trigger

        The notification and resource columns are required so they can not be 
updated
        with NULL value when there is no trigger linked.

        issue10622
        review369341002
        (grafted from 1b99cee3a0fd48ef324a0e56369aa1735270c494)
diffstat:

 notification.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 910c7a8fa34a -r c3b01bf20274 notification.py
--- a/notification.py   Fri Jan 01 16:28:35 2021 +0100
+++ b/notification.py   Thu Aug 12 18:36:32 2021 +0200
@@ -8,6 +8,7 @@
 from email.mime.nonmultipart import MIMENonMultipart
 from email.utils import getaddresses
 
+from sql import Null
 from sql.operators import Concat
 from genshi.template import TextTemplate
 
@@ -383,7 +384,8 @@
                 where=trigger.id == table.trigger))
         cursor.execute(*table.update(
                 [table.notification, table.resource],
-                [notification, resource]))
+                [notification, resource],
+                where=table.trigger != Null))
         table_h.not_null_action('trigger', 'remove')
 
     def get_date(self, name):

Reply via email to