fix: Cast cache key to str before calling encode (#6100)

This commit is contained in:
Jennifer Richards 2023-08-08 19:38:59 -03:00 committed by GitHub
parent baa5127d25
commit 82d91d371a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1200,7 +1200,7 @@ if 'CACHES' not in locals():
'VERSION': __version__,
'KEY_PREFIX': 'ietf:dt',
'KEY_FUNCTION': lambda key, key_prefix, version: (
f"{key_prefix}:{version}:{sha384(key.encode('utf8')).hexdigest()}"
f"{key_prefix}:{version}:{sha384(str(key).encode('utf8')).hexdigest()}"
),
},
'sessions': {