From aecb4722640bc49a8e479f5eb5f332346535be8d Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 8 Dec 2015 09:22:35 -0600 Subject: allow disabling the cache buster --- pyramid/config/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 304ce2d43..1115ccffc 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -1982,15 +1982,16 @@ class StaticURLInfo(object): self.cache_busters = [] def generate(self, path, request, **kw): + disable_cache_buster = ( + request.registry.settings['pyramid.prevent_cachebust']) for (url, spec, route_name) in self.registrations: if path.startswith(spec): subpath = path[len(spec):] if WIN: # pragma: no cover subpath = subpath.replace('\\', '/') # windows - # translate spec into overridden spec and lookup cache buster - # to modify subpath, kw - subpath, kw = self._bust_asset_path( - request.registry, spec, subpath, kw) + if not disable_cache_buster: + subpath, kw = self._bust_asset_path( + request.registry, spec, subpath, kw) if url is None: kw['subpath'] = subpath return request.route_url(route_name, **kw) -- cgit v1.2.3