mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26536 -- Preserved leading dashes of the cached template loader keys.
Thanks Anders Roos for the report.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user