Files
edx-platform/openedx/core/djangoapps/agreements/cache.py
Simon Chen 6d380fc5a2 [FEAT]: Add mem caching to the API to create and retrieve IntegritySignature (#27922)
With this change, whenever a IntegritySignature is created or retrieved, the result will be cached into mem cache for future use. This will save round trip to database significantly for honor code check
2021-06-10 14:45:06 -04:00

14 lines
462 B
Python

# lint-amnesty, pylint: disable=missing-module-docstring
# Template used to create cache keys for Integrity Signatures
INTEGRITY_SIGNATURE_CACHE_KEY_TPL = 'integrity-signature-{course_id}-{username}'
def get_integrity_signature_cache_key(username, course_id):
"""
Util function to help form the cache key for integrity signature
"""
return INTEGRITY_SIGNATURE_CACHE_KEY_TPL.format(
username=username,
course_id=course_id,
)