Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve os.getenv #89

Open
Xiphoseer opened this issue Jan 7, 2024 · 0 comments
Open

Improve os.getenv #89

Xiphoseer opened this issue Jan 7, 2024 · 0 comments

Comments

@Xiphoseer
Copy link
Contributor

Currently there are a bunch of lines like

app.config['REQUIRE_PLAY_KEY'] = os.getenv(
'REQUIRE_PLAY_KEY',
app.config['REQUIRE_PLAY_KEY']
)

in app/__init__.py

Given that os.getenv returns either the default or a string and

$ python3
>>> bool("")
False
>>> bool("1")
True
>>> bool("0")
True
>>> bool("True")
True
>>> bool("False")
True

this may not be the best way to parse boolean type values, because an if on just the value may cause unituitive configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant