From bb75fef1f69f52508ec14a0b57a79f53e95d599f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 19 Aug 2021 23:43:14 +0200 Subject: [PATCH] check env var SCODOC_ADMIN_MAIL --- .env-exemple | 1 + scodoc.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.env-exemple b/.env-exemple index b78080f6..02b219e5 100644 --- a/.env-exemple +++ b/.env-exemple @@ -10,6 +10,7 @@ FLASK_ENV=production # ou "development" si vous développez # MAIL_SERVER=localhost # MAIL_PORT=25 +# Obligatoire: SCODOC_ADMIN_MAIL="emmanuel@viennet.net" # Remplacer cette chaine diff --git a/scodoc.py b/scodoc.py index 599bf176..2ea8105b 100755 --- a/scodoc.py +++ b/scodoc.py @@ -71,6 +71,11 @@ def db_init(): # db-init Starts from an existing database and create all the necessary SQL tables and functions. """ + if not app.config.get("SCODOC_ADMIN_MAIL"): + sys.stderr.write( + """La variable SCODOC_ADMIN_MAIL n'est pas positionnée: vérifier votre .env""" + ) + return 100 initialize_scodoc_database()