From 1adbadbd57ef636c51f77bd42229e0d446ed4f3d Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 21 Jun 2023 13:55:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Fix=20UMAP=5FCUSTOM?= =?UTF-8?q?=5FTEMPLATES=20setting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- umap/settings/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umap/settings/__init__.py b/umap/settings/__init__.py index aef9ce63..0eae30c9 100644 --- a/umap/settings/__init__.py +++ b/umap/settings/__init__.py @@ -39,7 +39,10 @@ if path: # Retrocompat pre 1.0, remove me in 1.1. globals()['UMAP' + key[15:]] = value elif key == 'UMAP_CUSTOM_TEMPLATES': - globals()['TEMPLATES'][0]['DIRS'].insert(0, value) + if 'DIRS' in globals()['TEMPLATES'][0]: + globals()['TEMPLATES'][0]['DIRS'].insert(0, value) + else: + globals()['TEMPLATES'][0]['DIRS'] = [value] elif key == 'UMAP_CUSTOM_STATICS': globals()['STATICFILES_DIRS'].insert(0, value) else: