diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2020-10-07 08:55:21 +0200 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2020-10-07 08:55:21 +0200 |
commit | 0d58b67202aa9d1f4bec7cbfb828a84ff30f1d3c (patch) | |
tree | a70b5d2637e1b680d7596e4e43fb629f1c2f141f | |
parent | 9b54ed0ba513c4fe2e7d403b014e9819a8e84fa5 (diff) |
Fix converting decimal fields to dumpable values
-rw-r--r-- | lesana/collection.py | 4 |
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 |