mirror of
https://github.com/omaha-consulting/winget.pro.git
synced 2026-10-24 12:52:26 +00:00
14f9074079
This is from a time where the repo was called "winget-private-repository".
18 lines
417 B
Python
18 lines
417 B
Python
import os
|
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
|
|
|
|
|
def get_bool_from_env(name, default):
|
|
result_str = os.getenv(name)
|
|
if not result_str:
|
|
return default
|
|
if result_str == 'True':
|
|
return True
|
|
elif result_str == 'False':
|
|
return False
|
|
raise ImproperlyConfigured(
|
|
'Environment variable %r has invalid value. Must be True or False.'
|
|
% name
|
|
)
|