@app.route('/launch', methods=['POST'])
@lti(error=error, request='initial', role='staff', app=app)
def lti_tool(lti=lti):
    '\n    Bootstrapper for lti.\n    '
    course_id = request.values.get('custom_canvas_course_id')
    canvas_user_id = request.values.get('custom_canvas_user_id')
    canvas_domain = request.values.get('custom_canvas_api_domain')
    if (canvas_domain not in config.ALLOWED_CANVAS_DOMAINS):
        msg = '<p>This tool is only available from the following domain(s):<br/>{}</p><p>You attempted to access from this domain:<br/>{}</p>'
        return render_template('error.html', message=msg.format(', '.join(config.ALLOWED_CANVAS_DOMAINS), canvas_domain))
    roles = request.values.get('roles', [])
    session['is_admin'] = ('Administrator' in roles)
    session['canvas_user_id'] = canvas_user_id
    session['lti_logged_in'] = True
    return redirect(url_for('quiz', course_id=course_id))
Bootstrapper for lti.
@app.route('/launch', methods=['POST'])
@lti(error=error, request='initial', role='staff', app=app)
def lti_tool(lti=lti):
    '\n    \n    '
    course_id = request.values.get('custom_canvas_course_id')
    canvas_user_id = request.values.get('custom_canvas_user_id')
    canvas_domain = request.values.get('custom_canvas_api_domain')
    if (canvas_domain not in config.ALLOWED_CANVAS_DOMAINS):
        msg = '<p>This tool is only available from the following domain(s):<br/>{}</p><p>You attempted to access from this domain:<br/>{}</p>'
        return render_template('error.html', message=msg.format(', '.join(config.ALLOWED_CANVAS_DOMAINS), canvas_domain))
    roles = request.values.get('roles', [])
    session['is_admin'] = ('Administrator' in roles)
    session['canvas_user_id'] = canvas_user_id
    session['lti_logged_in'] = True
    return redirect(url_for('quiz', course_id=course_id))