Skip to content

Commit

Permalink
import-scripts: fix boolean rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
ncfavier committed Dec 6, 2020
1 parent 27ff900 commit 131d250
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions import-scripts/import_scripts/channel.py
Expand Up @@ -540,13 +540,13 @@ def toNix(value):

if value is None:
return "null"
elif isinstance(value, int) or isinstance(value, float):
elif type(value) in [int, float]:
return str(value)
elif isinstance(value, bool):
elif type(value) == bool:
return "true" if value else "false"
elif isinstance(value, list) and not value:
elif type(value) == list and not value:
return "[ ]"
elif isinstance(value, dict) and not value:
elif type(value) == dict and not value:
return "{ }"
else:
return jsonToNix(json.dumps(value))
Expand Down

0 comments on commit 131d250

Please sign in to comment.