Skip to content

Commit

Permalink
Pick org_defined_id from the right location
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospri committed Dec 12, 2024
1 parent 37ccadf commit 0d1248c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
19 changes: 3 additions & 16 deletions lms/models/lti_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
)


Expand Down
7 changes: 4 additions & 3 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}

Expand Down

0 comments on commit 0d1248c

Please sign in to comment.