mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-09 05:04:55 +00:00
Fixes unicode table names support on Python 2.
This commit is contained in:
parent
c9b1269210
commit
193758ff9c
1 changed files with 2 additions and 2 deletions
|
|
@ -55,11 +55,11 @@ def get_table_cache_key(db_alias, table):
|
|||
:return: A cache key
|
||||
:rtype: str
|
||||
"""
|
||||
cache_key = ('%s:%s' % (db_alias, table)).encode('utf-8')
|
||||
cache_key = ('%s:%s' % (db_alias, table))
|
||||
# We check if we have to hash the key since it should nearly never be
|
||||
# necessary.
|
||||
if len(cache_key) > MAX_CACHE_KEY_LENGTH:
|
||||
return sha1(cache_key).hexdigest()
|
||||
return sha1(cache_key.encode('utf-8')).hexdigest()
|
||||
return cache_key
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue