mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 11:32:38 +02:00
Manage staff through env var
This commit is contained in:
parent
abc5fd019d
commit
4704211b55
2 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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"\""})
|
||||
|
|
Loading…
Reference in a new issue