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

Boolean environmental variables #354

Closed
MagiX13 opened this issue Dec 13, 2021 · 1 comment · Fixed by #356
Closed

Boolean environmental variables #354

MagiX13 opened this issue Dec 13, 2021 · 1 comment · Fixed by #356
Labels
bug Reports of unexpected problems or errors

Comments

@MagiX13
Copy link

MagiX13 commented Dec 13, 2021

Hi,

I'm running babybuddy via the linuxserver docker container and failed to turn off the debug mode via environmental variables. Note that the linuxserver docker container sets DEBUG to False if not set, but this is interpreted as a string and thus treated as True.

Some investigation showed that the dotenv package does not support boolean variables, and thus whatever non-empty value the DEBUG env variable takes, it evaluates to True. See this issue: theskumar/python-dotenv#86 for reference
A potential fix could be converting the strings that are supposed to be boolean into a proper boolean, similar to how it's done for the 24h format, i.e.
DEBUG = bool(strtobool(os.getenv.get('DEBUG','False')))

Let me know if you would be willing to accept a pull request on this issue.

@cdubz
Copy link
Member

cdubz commented Dec 14, 2021

@MagiX13 a PR would be great. Thank you!

@cdubz cdubz added the bug Reports of unexpected problems or errors label Dec 14, 2021
@cdubz cdubz added this to the v1.9.4 milestone Dec 15, 2021
@cdubz cdubz removed this from the v1.9.4 milestone Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reports of unexpected problems or errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants