]> Devi Nivas Git - chevron.git/commitdiff
Fix 0 and False values not rendering.
authornoah morrison <noah@morrison.ph>
Mon, 26 Jan 2015 20:57:28 +0000 (15:57 -0500)
committernoah morrison <noah@morrison.ph>
Mon, 26 Jan 2015 20:57:28 +0000 (15:57 -0500)
0 and False should still be rendered, even though they are falsy.

chevron/renderer.py

index a3d1e9d8d8410198c361f3fa6e9a999bc469c9f7..7a3d93d410ae97c98375b5584052c9d8fff205ff 100644 (file)
@@ -60,6 +60,12 @@ def _get_key(key, scopes):
                 scope = scope[child]
             # Return the last scope we got
             # or an empty string if falsy
+
+            if scope is 0:
+                return 0
+            if scope is False:
+                return False
+
             return scope or ''
         except (TypeError, KeyError):
             # We couldn't find the key in the current scope