Skip to content

Commit f9cb60e

Browse files
committed
fix(lti): correct spelling and improve logging in signal handlers
• Fixed spelling errors (configurtion → configuration, url → URL) • Improved log messages to be more informative • Used more descriptive variable names (id_list → block_locations) • Maintained consistent code style and import organization
1 parent a0955d3 commit f9cb60e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lti_consumer/lti_xblock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ class LtiConsumerXBlock(StudioEditableXBlockMixin, XBlock):
374374
" requests received have the signature from the tool."
375375
"<br /><b>This is not required when doing LTI 1.3 Launches"
376376
" without LTI Advantage nor Basic Outcomes requests.</b>"
377-
"<br /><br /><b>Changing the public key or keyset url will cause the client ID, block keyset url "
378-
"and access token url to be regenerated if they are shared between blocks. "
377+
"<br /><br /><b>Changing the public key or keyset URL will cause the client ID, block keyset URL "
378+
"and access token URL to be regenerated if they are shared between blocks. "
379379
"Please check and update them in the LTI tool settings if necessary.</b>"
380380
),
381381
)
@@ -391,8 +391,8 @@ class LtiConsumerXBlock(StudioEditableXBlockMixin, XBlock):
391391
"from the tool."
392392
"<br /><b>This is not required when doing LTI 1.3 Launches without LTI Advantage nor "
393393
"Basic Outcomes requests.</b>"
394-
"<br /><br /><b>Changing the public key or keyset url will cause the client ID, block keyset url "
395-
"and access token url to be regenerated if they are shared between blocks. "
394+
"<br /><br /><b>Changing the public key or keyset URL will cause the client ID, block keyset URL "
395+
"and access token URL to be regenerated if they are shared between blocks. "
396396
"Please check and update them in the LTI tool settings if necessary.</b>"
397397
),
398398
)

lti_consumer/signals/signals.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def publish_grade_on_score_update(sender, instance, **kwargs): # pylint: disabl
3232
# have permissions to.
3333
# TODO: This security mechanism will need to be reworked once we enable LTI 1.3
3434
# reusability to allow one configuration to save scores on multiple placements,
35-
# but still locking down access to the items that are using the LTI configurtion.
35+
# but still locking down access to the items that are using the LTI configuration.
3636
if line_item.resource_link_id != lti_config.location:
3737
log.warning(
3838
"LTI tool tried publishing score %r to block %s (outside allowed scope of: %s).",
@@ -92,7 +92,7 @@ def create_lti_1p3_passport(sender, instance: LtiConfiguration, **kwargs): # py
9292
@receiver(SignalHandler.pre_item_delete if SignalHandler else [])
9393
def delete_child_lti_configurations(**kwargs):
9494
"""
95-
Delete lti configurtion from database for this block children.
95+
Delete lti configuration from database for this block children.
9696
"""
9797
usage_key = kwargs.get('usage_key')
9898
if usage_key:
@@ -103,22 +103,22 @@ def delete_child_lti_configurations(**kwargs):
103103
except Exception as e: # pylint: disable=broad-exception-caught
104104
log.warning(f"Cannot find xblock for key {usage_key}. Reason: {str(e)}. ")
105105
return
106-
id_list = {str(deleted_block.location)}
106+
block_locations = {str(deleted_block.location)}
107107
for block in compat.yield_dynamic_block_descendants(deleted_block, kwargs.get('user_id')):
108-
id_list.add(str(block.location))
108+
block_locations.add(str(block.location))
109109

110110
LtiConfiguration.objects.filter(
111-
location__in=id_list
111+
location__in=block_locations
112112
).delete()
113-
log.info(f"Deleted {len(id_list)} lti configurations in modulestore")
113+
log.info(f"Deleted {len(block_locations)} LTI configurations for block and its children in modulestore")
114114
result = Lti1p3Passport.objects.filter(lticonfiguration__isnull=True).delete()
115115
log.info(f"Deleted {result} lti 1.3 passport objects in library")
116116

117117

118118
@receiver(XBLOCK_DELETED)
119119
def delete_lti_configuration(**kwargs):
120120
"""
121-
Delete lti configurtion from database for this block.
121+
Delete lti configuration from database for this block.
122122
"""
123123
xblock_info = kwargs.get("xblock_info", None)
124124
if not xblock_info or not isinstance(xblock_info, XBlockData):
@@ -135,7 +135,7 @@ def delete_lti_configuration(**kwargs):
135135
@receiver(LIBRARY_BLOCK_DELETED)
136136
def delete_lib_lti_configuration(**kwargs):
137137
"""
138-
Delete lti configurtion from database for this library block.
138+
Delete lti configuration from database for this library block.
139139
"""
140140
library_block = kwargs.get("library_block", None)
141141
if not library_block or not isinstance(library_block, LibraryBlockData):

0 commit comments

Comments
 (0)