Manage staff through env var

This commit is contained in:
Yohan Boniface 2019-04-07 09:33:23 +02:00
parent abc5fd019d
commit 4704211b55
2 changed files with 4 additions and 1 deletions

View file

@ -11,7 +11,7 @@ SMTP_HOST = "mail.gandi.net"
SMTP_PASSWORD = ""
SMTP_LOGIN = ""
FROM_EMAIL = "copanier@epinamap.org"
STAFF = ["yohanboniface@free.fr", "anne.mattler@wanadoo.fr"]
STAFF = []
LOCALE = "fr_FR.UTF-8"
@ -20,6 +20,8 @@ def init():
if key.isupper():
env_key = "COPANIER_" + key
typ = type(value)
if typ == list:
typ = lambda x: x.split()
if env_key in os.environ:
globals()[key] = typ(os.environ[env_key])
locale.setlocale(locale.LC_ALL, LOCALE)

View file

@ -184,6 +184,7 @@ def upload_env():
"COPANIER_SEND_EMAILS": "1",
"COPANIER_SMTP_PASSWORD": None,
"COPANIER_SMTP_LOGIN": None,
"COPANIER_STAFF": None,
}
content = ""
table = str.maketrans({'"': r"\""})