Refs #27795 -- Removed force_bytes() usage in django/template/loaders/cached.py.
This commit is contained in:
parent
968329b5c2
commit
1f3852b708
|
@ -7,7 +7,6 @@ import hashlib
|
||||||
|
|
||||||
from django.template import TemplateDoesNotExist
|
from django.template import TemplateDoesNotExist
|
||||||
from django.template.backends.django import copy_exception
|
from django.template.backends.django import copy_exception
|
||||||
from django.utils.encoding import force_bytes
|
|
||||||
|
|
||||||
from .base import Loader as BaseLoader
|
from .base import Loader as BaseLoader
|
||||||
|
|
||||||
|
@ -88,7 +87,7 @@ class Loader(BaseLoader):
|
||||||
return '-'.join(s for s in (str(template_name), skip_prefix, dirs_prefix) if s)
|
return '-'.join(s for s in (str(template_name), skip_prefix, dirs_prefix) if s)
|
||||||
|
|
||||||
def generate_hash(self, values):
|
def generate_hash(self, values):
|
||||||
return hashlib.sha1(force_bytes('|'.join(values))).hexdigest()
|
return hashlib.sha1('|'.join(values).encode()).hexdigest()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
"Empty the template cache."
|
"Empty the template cache."
|
||||||
|
|
Loading…
Reference in New Issue