# HG changeset patch # User Ludovic Chabant # Date 1560291167 25200 # Node ID 4ea64255eadf547978e4cf45e2be28f7e1ebba61 # Parent fac4483867a5283074c2b19790cda52455fec65c sources: Add ability to force a realm on a source. diff -r fac4483867a5 -r 4ea64255eadf piecrust/sources/fs.py --- a/piecrust/sources/fs.py Tue Jun 11 15:11:39 2019 -0700 +++ b/piecrust/sources/fs.py Tue Jun 11 15:12:47 2019 -0700 @@ -3,6 +3,7 @@ import glob import fnmatch import logging +from werkzeug.utils import cached_property from piecrust import osutil from piecrust.routing import RouteParameter from piecrust.sources.base import ( @@ -34,9 +35,9 @@ self.fs_endpoint = config.get('fs_endpoint', name) self.fs_endpoint_path = os.path.join(self.root_dir, self.fs_endpoint) - @property + @cached_property def root_dir(self): - if self.is_theme_source: + if self.is_theme_source and not self.config.get('force_user_realm'): return self.app.theme_dir return self.app.root_dir