Skip to content

Commit

Permalink
debug: commit for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mfarhan943 committed Mar 18, 2024
1 parent 376b40b commit 55186da
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lti_consumer/plugin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,13 @@ def launch_gate_endpoint(request, suffix=None): # pylint: disable=unused-argume
# Deep Linking Launch - Configuration flow launched by
# course creators to set up content.
deep_linking_content_item_id = launch_data.deep_linking_content_item_id

log.error("abc-launch-message %s \n %s", launch_data.message_type, lti_consumer.dl)
if launch_data.message_type == 'LtiDeepLinkingRequest' and lti_consumer.dl:
# Check if the user is staff before LTI doing deep linking launch.
# If not, raise exception and display error page
if user_role not in ['instructor', 'staff']:
raise AssertionError('Deep Linking can only be performed by instructors and staff.')
log.error("abcde9876 %s ", user_role)
# if user_role not in ['instructor', 'staff']: # Assert
# raise AssertionError('Deep Linking can only be performed by instructors and staff.')
# Set deep linking launch
context.update({'launch_url': lti_consumer.dl.deep_linking_launch_url})

Expand All @@ -245,7 +246,9 @@ def launch_gate_endpoint(request, suffix=None): # pylint: disable=unused-argume
# different parameters, set by instructors when running the DL configuration flow.
elif deep_linking_content_item_id and lti_consumer.dl:
# Retrieve Deep Linking parameters using the parameter.
content_item = lti_config.ltidlcontentitem_set.get(pk=deep_linking_content_item_id)
log.error("before-content\n")
content_item = lti_config.ltidlcontentitem_set.get(pk=deep_linking_content_item_id) # Assert
log.error("xyz1234 %s ", content_item)
# Only filter DL content item from content item set in the same LTI configuration.
# This avoids a malicious user to input a random LTI id and perform LTI DL
# content launches outside the scope of its configuration.
Expand Down

0 comments on commit 55186da

Please sign in to comment.