mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +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_PASSWORD = ""
|
||||||
SMTP_LOGIN = ""
|
SMTP_LOGIN = ""
|
||||||
FROM_EMAIL = "copanier@epinamap.org"
|
FROM_EMAIL = "copanier@epinamap.org"
|
||||||
STAFF = ["yohanboniface@free.fr", "anne.mattler@wanadoo.fr"]
|
STAFF = []
|
||||||
LOCALE = "fr_FR.UTF-8"
|
LOCALE = "fr_FR.UTF-8"
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ def init():
|
||||||
if key.isupper():
|
if key.isupper():
|
||||||
env_key = "COPANIER_" + key
|
env_key = "COPANIER_" + key
|
||||||
typ = type(value)
|
typ = type(value)
|
||||||
|
if typ == list:
|
||||||
|
typ = lambda x: x.split()
|
||||||
if env_key in os.environ:
|
if env_key in os.environ:
|
||||||
globals()[key] = typ(os.environ[env_key])
|
globals()[key] = typ(os.environ[env_key])
|
||||||
locale.setlocale(locale.LC_ALL, LOCALE)
|
locale.setlocale(locale.LC_ALL, LOCALE)
|
||||||
|
|
|
@ -184,6 +184,7 @@ def upload_env():
|
||||||
"COPANIER_SEND_EMAILS": "1",
|
"COPANIER_SEND_EMAILS": "1",
|
||||||
"COPANIER_SMTP_PASSWORD": None,
|
"COPANIER_SMTP_PASSWORD": None,
|
||||||
"COPANIER_SMTP_LOGIN": None,
|
"COPANIER_SMTP_LOGIN": None,
|
||||||
|
"COPANIER_STAFF": None,
|
||||||
}
|
}
|
||||||
content = ""
|
content = ""
|
||||||
table = str.maketrans({'"': r"\""})
|
table = str.maketrans({'"': r"\""})
|
||||||
|
|
Loading…
Reference in a new issue