From 0d1248c3fc3d45ce78bd3567bcca32c4567e0c64 Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Thu, 12 Dec 2024 11:27:09 +0100 Subject: [PATCH] Pick org_defined_id from the right location Use "http://www.brightspace.com" -> "org_defined_id" instead of nesting that on "https://purl.imsglobal.org/spec/lti/claim/launch_presentation" --- lms/models/lti_params.py | 19 +++---------------- tests/unit/conftest.py | 7 ++++--- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/lms/models/lti_params.py b/lms/models/lti_params.py index 3547be8cca..5a4d27f0c1 100644 --- a/lms/models/lti_params.py +++ b/lms/models/lti_params.py @@ -183,23 +183,10 @@ def _apply_canvas_quirks(lti_params, request): # To make upgrades seamless we prefer the LTI1.1 version when available # # http://www.imsglobal.org/spec/lti/v1p3/migr#lti-1-1-migration-claim - ( - "user_id", - [f"{CLAIM_PREFIX}/lti1p1", "user_id"], - ), - ( - "resource_link_id", - [f"{CLAIM_PREFIX}/lti1p1", "resource_link_id"], - ), + ("user_id", [f"{CLAIM_PREFIX}/lti1p1", "user_id"]), + ("resource_link_id", [f"{CLAIM_PREFIX}/lti1p1", "resource_link_id"]), # LMS dependant variables that are not part of the "custom" claim - ( - "org_defined_id", - [ - "https://purl.imsglobal.org/spec/lti/claim/launch_presentation", - "http://www.brightspace.com", - "org_defined_id", - ], - ), + ("org_defined_id", ["http://www.brightspace.com", "org_defined_id"]), ) diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index d88d456c46..8b1d5c4e11 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -92,9 +92,10 @@ def lti_v13_params(): "canvas_api_domain": "hypothesis.instructure.com", }, "https://purl.imsglobal.org/spec/lti/claim/launch_presentation": { - "http://www.brightspace.com": { - "org_defined_id": "ORG_DEFINED_ID", - } + "locale": "en-us" + }, + "http://www.brightspace.com": { + "org_defined_id": "ORG_DEFINED_ID", }, }