From 4704211b55eaa6bb016ded65a0461d777ad1f653 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 7 Apr 2019 09:33:23 +0200 Subject: [PATCH] Manage staff through env var --- copanier/config.py | 4 +++- remote/__main__.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/copanier/config.py b/copanier/config.py index 48cbdbf..eeef361 100644 --- a/copanier/config.py +++ b/copanier/config.py @@ -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) diff --git a/remote/__main__.py b/remote/__main__.py index 0949f97..140988c 100644 --- a/remote/__main__.py +++ b/remote/__main__.py @@ -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"\""})