def populate_session_msg_context(request, context):
    """
    Takes an existing ``context`` object (as constructed in
    ``get_context_data()`` and populates any session messages
    we may have.
    """
    for varname in ['success', 'fail']:
        session_var = 'exordium_msg_%s' % varname
        ctx_var = 'messages_%s' % varname
        if session_var in request.session:
            if len(request.session[session_var]) > 0:
                context[ctx_var] = request.session[session_var]
                del request.session[session_var]
