Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truncate the display_name field to a maximum 255 characters #141

Open
wants to merge 1 commit into
base: pearson-release/olive.stage
Choose a base branch
from

Conversation

MAAngamarca
Copy link

Description

This PR amis to truncate display_name field to prevent the following error:
django.db.utils.DataError: (1406, "Data too long for column 'display_name' at row 1")
This error occurs when attempting to create or update an XBlockCache.

Testing instructions

Create a course with Blank Common Problem and set the following name:
Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Duplicate of 'Blank Common Problem''''''''''''''''

From a cms shell, run the following code:

from openedx.core.djangoapps.bookmarks.tasks import update_xblocks_cache
update_xblocks_cache(<course-id>)

And the xblock cached should be created sucessfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant