From 892bda66b52814f939afda3167606a2a500710ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 12 Aug 2021 18:36:32 +0200 Subject: [PATCH] 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) --HG-- branch : 6.0 --- notification.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notification.py b/notification.py index bf708cd6bc..ccc6ceb3c0 100644 --- a/notification.py +++ b/notification.py @@ -8,6 +8,7 @@ from email.mime.multipart import MIMEMultipart 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 @@ -387,7 +388,8 @@ class EmailLog(ResourceAccessMixin, ModelSQL, ModelView): 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):