diff piecrust/data/assetor.py @ 975:a0a62d0da723

internal: Check that the `Assetor` has an asset URL format to work with.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 17 Oct 2017 01:08:56 -0700
parents 9d804fa186a0
children 8adc27285d93
line wrap: on
line diff
--- a/piecrust/data/assetor.py	Tue Oct 17 01:07:30 2017 -0700
+++ b/piecrust/data/assetor.py	Tue Oct 17 01:08:56 2017 -0700
@@ -81,6 +81,8 @@
         app = source.app
         root_dir = app.root_dir
         asset_url_format = app.config.get('site/asset_url_format')
+        if not asset_url_format:
+            raise Exception("No asset URL format was specified.")
 
         page_uri = self._page.getUri()
         pretty_urls = app.config.get('site/pretty_urls')