Allow missing CODES_EXPL and ABSOLUTE_URL in custom config

This commit is contained in:
viennet 2020-10-06 12:12:06 +02:00
parent ba7ae269a7
commit b4e1b0a955
2 changed files with 3 additions and 2 deletions

View File

@ -108,7 +108,7 @@ import sco_dump_db
from VERSION import SCOVERSION, SCONEWS 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: ABSOLUTE_URL='%s'" % CONFIG.ABSOLUTE_URL)
log("ScoDoc: using encoding %s" % SCO_ENCODING) log("ScoDoc: using encoding %s" % SCO_ENCODING)

View File

@ -230,7 +230,8 @@ except:
sys.stderr.write("sco_utils: error in configuration file %s" % _config_filename) sys.stderr.write("sco_utils: error in configuration file %s" % _config_filename)
raise 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: if CONFIG.CUSTOM_HTML_HEADER: