Skip to content

Commit

Permalink
fix: truncate the display_name field to a maximum 255 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
MAAngamarca committed Nov 19, 2024
1 parent 4530cd0 commit 8899a6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/bookmarks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def update_block_cache_if_needed(block_cache, block_data):
paths = _paths_from_data(block_data['paths'])
if block_cache.display_name != block_data['display_name'] or not paths_equal(block_cache.paths, paths):
log.info('Updating XBlockCache with usage_key: %s', str(block_cache.usage_key))
block_cache.display_name = block_data['display_name']
block_cache.display_name = block_data['display_name'][:255]
block_cache.paths = paths
block_cache.save()

Expand All @@ -136,7 +136,7 @@ def update_block_cache_if_needed(block_cache, block_data):
log.info('Creating XBlockCache with usage_key: %s', str(block_data['usage_key']))
block_cache, created = XBlockCache.objects.get_or_create(usage_key=block_data['usage_key'], defaults={
'course_key': course_key,
'display_name': block_data['display_name'],
'display_name': block_data['display_name'][:255],
'paths': paths,
})

Expand Down

0 comments on commit 8899a6e

Please sign in to comment.