Skip to content

Commit

Permalink
Take instructors directly to the class config on LTI login.
Browse files Browse the repository at this point in the history
  • Loading branch information
liffiton committed Jul 22, 2024
1 parent a701df3 commit 9a57351
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/gened/lti.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion tests/test_lti.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a57351

Please sign in to comment.