From 9a573515f19c745c8d79a883153d51e43c705bfc Mon Sep 17 00:00:00 2001 From: Mark Liffiton Date: Mon, 22 Jul 2024 13:59:46 -0500 Subject: [PATCH] Take instructors directly to the class config on LTI login. --- src/gened/lti.py | 5 ++++- tests/test_lti.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gened/lti.py b/src/gened/lti.py index 48c4490..9a31c1b 100644 --- a/src/gened/lti.py +++ b/src/gened/lti.py @@ -121,7 +121,10 @@ def lti_login(lti: LTI) -> Response | tuple[str, int]: # noqa: ARG001 (unused a set_session_auth_role(role_id) # Redirect to the app - return redirect(url_for("helper.help_form")) + if role == "instructor": + return redirect(url_for("class_config.config_form")) + else: + return redirect(url_for("helper.help_form")) @bp.route("/config.xml") diff --git a/tests/test_lti.py b/tests/test_lti.py index b716ff0..30e7e8a 100644 --- a/tests/test_lti.py +++ b/tests/test_lti.py @@ -85,7 +85,10 @@ def test_lti_auth_success(client, role, internal_role): assert "LTI communication error" not in result.text # success == redirect to help page... assert result.status_code == 302 - assert result.location == '/help/' + if internal_role == 'instructor': + assert result.location == '/instructor/config/' + else: + assert result.location == '/help/' result = client.get('/help/') assert result.status_code == 200