summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-08-19 18:17:45 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-08-19 18:17:45 +0200
commita2c8c2617e3bfc95b4d6c396c56afabeee59dadf (patch)
tree85ae47a27552839a82bb598a96b4e994c6165ef8
parent8e15a0763e3476e333b1e71b70015cf3bd757160 (diff)
Allow empty list fields
-rw-r--r--lesana/collection.py2
-rw-r--r--tests/data/complex/items/28b15099c84b41ab892133cd64876a32.yaml6
2 files changed, 8 insertions, 0 deletions
diff --git a/lesana/collection.py b/lesana/collection.py
index cbdd3a7..50ed21e 100644
--- a/lesana/collection.py
+++ b/lesana/collection.py
@@ -155,6 +155,8 @@ class Collection(object):
values = entry.data.get(field['name'])
else:
values = [entry.data.get(field['name'])]
+ if not values:
+ values = []
for v in values:
try:
self.indexer.index_text(
diff --git a/tests/data/complex/items/28b15099c84b41ab892133cd64876a32.yaml b/tests/data/complex/items/28b15099c84b41ab892133cd64876a32.yaml
new file mode 100644
index 0000000..58b84bb
--- /dev/null
+++ b/tests/data/complex/items/28b15099c84b41ab892133cd64876a32.yaml
@@ -0,0 +1,6 @@
+name: 'A tagless item'
+description: |
+ .
+position: 'somewhere'
+something: ''
+tags: