summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-04-24 15:28:12 -0400
committerSimon Charette <charette.s@gmail.com>2016-04-24 22:15:45 -0400
commitbd145e7209a0e628cced10384bd6f62d65c0f211 (patch)
tree84da42a2e09f67603e31bd6e4ecb79c8b0b2a5a8 /django
parent218175b09d244b9c7c84c2f2d5f478297251bbe9 (diff)
Fixed #26536 -- Preserved leading dashes of the cached template loader keys.
Thanks Anders Roos for the report.
Diffstat (limited to 'django')
-rw-r--r--django/template/loaders/cached.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/template/loaders/cached.py b/django/template/loaders/cached.py
index 70c55feb51..1a3851d280 100644
--- a/django/template/loaders/cached.py
+++ b/django/template/loaders/cached.py
@@ -100,7 +100,7 @@ class Loader(BaseLoader):
if template_dirs:
dirs_prefix = self.generate_hash(template_dirs)
- return ("%s-%s-%s" % (template_name, skip_prefix, dirs_prefix)).strip('-')
+ return '-'.join(filter(bool, [template_name, skip_prefix, dirs_prefix]))
def generate_hash(self, values):
return hashlib.sha1(force_bytes('|'.join(values))).hexdigest()