only cleanup if needed

This commit is contained in:
j 2017-03-12 14:51:52 +02:00
parent 4733dc8994
commit ed7a56a5e9

View file

@ -354,7 +354,7 @@ class Document(models.Model):
elif ktype == 'text': elif ktype == 'text':
if data[key]: if data[key]:
self.data[key] = ox.sanitize_html(data[key]) self.data[key] = ox.sanitize_html(data[key])
else: elif key in self.data:
del self.data[key] del self.data[key]
elif ktype == '[text]': elif ktype == '[text]':
self.data[key] = [ox.sanitize_html(t) for t in data[key]] self.data[key] = [ox.sanitize_html(t) for t in data[key]]