From 0d58b67202aa9d1f4bec7cbfb828a84ff30f1d3c Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Wed, 7 Oct 2020 08:55:21 +0200 Subject: Fix converting decimal fields to dumpable values --- lesana/collection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3