Skip to content

Improve os.getenv #89

@Xiphoseer

Description

@Xiphoseer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions