()
returns a 7 character string that varies with the current "session" (task or request)
returns a 7 character string that varies with the current "session" (task or request)
returns a 7 character string that varies with the current session ( task or request )
def get_session_key():
    """
    returns a 7 character string that varies with the current "session" (task or request)
    """
    current_task = get_current_task()
    if current_task is not None:
        return _quickcache_id(current_task.request)
    request = get_request()
    if request is not None:
        return _quickcache_id(request)
    # quickcache catches this and skips the cache
    # this happens during tests (outside a fake task/request context)
    # and during management commands
    raise ForceSkipCache("Not part of a session")
def get_session_key ( ) : current_task = get_current_task ( ) if current_task is not None : return _quickcache_id ( current_task . request ) request = get_request ( ) if request is not None : return _quickcache_id ( request ) # quickcache catches this and skips the cache # this happens during tests (outside a fake task/request context) # and during management commands raise ForceSkipCache ( "Not part of a session" )