changeset 521:39175c48a4ae

config: Make sure `site/auto_formats` has at least `html`.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 28 Jul 2015 21:23:11 -0700
parents bab91fcef741
children 094bdf2f7c4c
files piecrust/app.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/app.py	Tue Jul 28 18:34:21 2015 -0700
+++ b/piecrust/app.py	Tue Jul 28 21:23:11 2015 -0700
@@ -150,9 +150,8 @@
         if not isinstance(sitec['auto_formats'], dict):
             raise ConfigurationError("The 'site/auto_formats' setting must be "
                                      "a dictionary.")
-        html_auto_format = sitec['auto_formats']
-        if not html_auto_format:
-            sitec['auto_formats']['html'] = sitec['default_format']
+        # Check that `.html` is in there.
+        sitec['auto_formats'].setdefault('html', sitec['default_format'])
         cachec['auto_formats_re'] = r"\.(%s)$" % (
                 '|'.join(
                         [re.escape(i) for i in