diff sat/memory/sqlite.py @ 3191:7255286a298a

memory (sqlite): don't store empty messages
author Goffi <goffi@goffi.org>
date Wed, 26 Feb 2020 22:03:15 +0100
parents 330a5f1d9eea
children 780fb8dd07ef
line wrap: on
line diff
--- a/sat/memory/sqlite.py	Wed Feb 26 22:03:15 2020 +0100
+++ b/sat/memory/sqlite.py	Wed Feb 26 22:03:15 2020 +0100
@@ -442,6 +442,9 @@
         d_list = []
         for key in ('message', 'subject'):
             for lang, value in data[key].items():
+                if not value.strip():
+                    # no need to store empty messages
+                    continue
                 d = self.dbpool.runQuery(
                     "INSERT INTO {key}(history_uid, {key}, language) VALUES (?,?,?)"
                     .format(key=key),