Skip to content

Commit

Permalink
Ensure that 'want_users' is output as boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
nikdoof committed Apr 11, 2021
1 parent 142312e commit b244274
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config-example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = dimension.sh
url = https://dimension.sh
signup_url = https://dimension.sh/join.html
want_users = True
want_users = true
admin_email = [email protected]
description = dimension.sh is a small public linux shell host (or pubnix system) that is open to anyone who wants to learn, experiment, and socialize with other like minded people.

Expand Down
9 changes: 9 additions & 0 deletions tildejsongen.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
}


def str2bool(v):
return v.lower() in ("yes", "true", "t", "1")


def get_config(filename=None):
"""Identify the config file to use and load it"""
if filename:
Expand Down Expand Up @@ -127,6 +131,11 @@ def main():

# Generate data Dict
data = dict(cfg.items(section='info'))

# Ensure 'want_users' is a bool, if it set
if 'want_users' in data:
data['want_users'] = str2bool(data['want_users'])

users = get_users(cfg)
data.update({
'users': users,
Expand Down

0 comments on commit b244274

Please sign in to comment.