Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
7d8329e5
Commit
7d8329e5
authored
Apr 01, 2020
by
BAIRE Anthony
Browse files
fixed parse_bool
parent
7d01d42b
Changes
1
Hide whitespace changes
Inline
Side-by-side
django/config/settings.py
View file @
7d8329e5
...
...
@@ -12,10 +12,10 @@ APPS_DIR = os.path.join(ROOT_DIR, 'allgo')
#FIXME: we should rather do these type conversions in config/env.py because
# this is very error prone
def
parse_bool
(
value
):
if
value
.
lower
()
in
(
1
,
"true"
):
def
parse_bool
(
value
:
str
):
if
value
.
lower
()
in
(
"1"
,
"true"
):
return
True
if
value
.
lower
()
in
(
0
,
"false"
):
if
value
.
lower
()
in
(
"0"
,
"false"
,
""
):
return
False
raise
ValueError
(
"invalid value %r (expected 'true' or 'false')"
%
value
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment