From 8899a6e9c2b40b6e20b758aec64886223dd9c83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Ar=C3=A9valo?= Date: Tue, 19 Nov 2024 15:37:11 -0500 Subject: [PATCH] fix: truncate the display_name field to a maximum 255 characters --- openedx/core/djangoapps/bookmarks/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/bookmarks/tasks.py b/openedx/core/djangoapps/bookmarks/tasks.py index 836335c1289c..d6629ddef6f2 100644 --- a/openedx/core/djangoapps/bookmarks/tasks.py +++ b/openedx/core/djangoapps/bookmarks/tasks.py @@ -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() @@ -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, })