From b4e1b0a9557f2d1827e206a103c33951ee32146c Mon Sep 17 00:00:00 2001 From: viennet Date: Tue, 6 Oct 2020 12:12:06 +0200 Subject: [PATCH] Allow missing CODES_EXPL and ABSOLUTE_URL in custom config --- ZScolar.py | 2 +- sco_utils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ZScolar.py b/ZScolar.py index 209a60940..4a536358d 100644 --- a/ZScolar.py +++ b/ZScolar.py @@ -108,7 +108,7 @@ import sco_dump_db from VERSION import SCOVERSION, SCONEWS -if CONFIG.ABSOLUTE_URL: +if hasattr(CONFIG, "ABSOLUTE_URL") and CONFIG.ABSOLUTE_URL: log("ScoDoc: ABSOLUTE_URL='%s'" % CONFIG.ABSOLUTE_URL) log("ScoDoc: using encoding %s" % SCO_ENCODING) diff --git a/sco_utils.py b/sco_utils.py index 732ed896f..9e9da47d7 100644 --- a/sco_utils.py +++ b/sco_utils.py @@ -230,7 +230,8 @@ except: sys.stderr.write("sco_utils: error in configuration file %s" % _config_filename) raise -CODES_EXPL.update(CONFIG.CODES_EXPL) # peremt de customiser les explications de codes +if hasattr(CONFIG, "CODES_EXPL"): + CODES_EXPL.update(CONFIG.CODES_EXPL) # permet de customiser les explications de codes if CONFIG.CUSTOM_HTML_HEADER: