From ed7a56a5e9945bf06328af0b7b9fe9d570cf6add Mon Sep 17 00:00:00 2001 From: j Date: Sun, 12 Mar 2017 14:51:52 +0200 Subject: [PATCH] only cleanup if needed --- pandora/document/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/document/models.py b/pandora/document/models.py index 3bce72a9c..f4bb480f9 100644 --- a/pandora/document/models.py +++ b/pandora/document/models.py @@ -354,7 +354,7 @@ class Document(models.Model): elif ktype == 'text': if data[key]: self.data[key] = ox.sanitize_html(data[key]) - else: + elif key in self.data: del self.data[key] elif ktype == '[text]': self.data[key] = [ox.sanitize_html(t) for t in data[key]]