summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-12-16 19:50:13 -0600
committerMichael Merickel <michael@merickel.org>2015-12-16 19:50:13 -0600
commitca573ea73db05d7ea9bdbb51eb7db26ab602ccf2 (patch)
tree2fe98ae21dec088668717e3d756add1eb88a95bd
parent4d19b84cb8134a0e7f030064e5d944defaa6970a (diff)
downloadpyramid-ca573ea73db05d7ea9bdbb51eb7db26ab602ccf2.tar.gz
pyramid-ca573ea73db05d7ea9bdbb51eb7db26ab602ccf2.tar.bz2
pyramid-ca573ea73db05d7ea9bdbb51eb7db26ab602ccf2.zip
defer prevent check until register
-rw-r--r--pyramid/config/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 759276351..acaf9462b 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -2102,9 +2102,6 @@ class StaticURLInfo(object):
config.action(None, callable=register, introspectables=(intr,))
def add_cache_buster(self, config, spec, cachebust, explicit=False):
- if config.registry.settings.get('pyramid.prevent_cachebust'):
- return
-
# ensure the spec always has a trailing slash as we only support
# adding cache busters to folders, not files
if os.path.isabs(spec): # FBO windows
@@ -2115,6 +2112,9 @@ class StaticURLInfo(object):
spec = spec + sep
def register():
+ if config.registry.settings.get('pyramid.prevent_cachebust'):
+ return
+
cache_busters = self.cache_busters
# find duplicate cache buster (old_idx)
@@ -2138,6 +2138,7 @@ class StaticURLInfo(object):
if old_idx is not None:
cache_busters.pop(old_idx)
+
cache_busters.insert(new_idx, (spec, cachebust, explicit))
intr = config.introspectable('cache busters',