Fixed conversion errors in inn_to_gasthausbox.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 29 Jan 2017 22:18:55 +0000 (22:18 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 29 Jan 2017 22:18:55 +0000 (22:18 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@2625 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrpylib/wrmwmarkup.py

index f0919de3975717023bc02fdb5698b1ce230a656b..f705fecbc7b39a845979709da446d6d458f68959 100644 (file)
@@ -112,9 +112,8 @@ def inn_from_gasthausbox(value, inn):
 def inn_to_gasthausbox(inn):
     """Converts an inn class to a dict of Gasthausbox properties. value is an Inn instance."""
     def convfromdb(value, key):
-        if value is None:
-            return None
-        return GASTHAUSBOX_DICT[key].from_str(value)
+        v = '' if value is None else value
+        return GASTHAUSBOX_DICT[key].from_str(v)
     value = collections.OrderedDict()
     value['Position'] = LonLat(inn.position_longitude, inn.position_latitude)
     value['Höhe'] = inn.position_elevation