Mercurial > piecrust2
changeset 1156:4ea64255eadf
sources: Add ability to force a realm on a source.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 11 Jun 2019 15:12:47 -0700 |
parents | fac4483867a5 |
children | 40a40305c4e1 |
files | piecrust/sources/fs.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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