summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2020-10-07 08:55:21 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2020-10-07 08:55:21 +0200
commit0d58b67202aa9d1f4bec7cbfb828a84ff30f1d3c (patch)
treea70b5d2637e1b680d7596e4e43fb629f1c2f141f
parent9b54ed0ba513c4fe2e7d403b014e9819a8e84fa5 (diff)
Fix converting decimal fields to dumpable values
-rw-r--r--lesana/collection.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lesana/collection.py b/lesana/collection.py
index ecb3eca..21eb364 100644
--- a/lesana/collection.py
+++ b/lesana/collection.py
@@ -78,7 +78,9 @@ class Entry(object):
# should be enough for all cases that we need.
for field in self.collection.settings['fields']:
if field['type'] == 'decimal':
- to_dump[field['name']] = str(to_dump.get(field['name'], ''))
+ v = to_dump.get(field['name'], '')
+ if v:
+ to_dump[field['name']] = str(v)
return ruamel.yaml.dump(to_dump, Dumper=ruamel.yaml.RoundTripDumper)
@property