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: exclude 'course_key' field from the django admin form on course_action_state #36218

Closed
wants to merge 1 commit into from

Conversation

schenedx
Copy link
Contributor

@schenedx schenedx commented Feb 4, 2025

Description

With this change, the course_action_state django admin form will not retrieve "course_key" field from the database. This is desired to use the django admin form to delete the erroneous data.

Context

There is a piece of bad data stored on edx.org stage environment in the database table course_action_state_coursererunstate. The course_key value is an invalid opaque key. Because of this bad piece of data, the edX staff view of the edx studio home page fails to load any course runs. We want to use this change on the django admin to bypass the bad course_key value, so we can delete the bad piece of data in the table named above.

Testing instructions

This change is tested on local machine with erroneous data stored on local mysql database.

def get_queryset(self, request):
# For any query against this table, remove course_key field
# because that field might have bad data in it.
qs =CourseRerunState.objects.defer('course_key')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space here needed after the = sign. Are we concerned with this introducing any latency whatsoever? Is it better to delete the row instead, is what I'm getting to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not concerned with latency with this change. I believe if this change works, the change to db should be immediate.
I think we should try to merge this PR, let me self-serve, before we ask you to delete from the stage environment directly.

@schenedx schenedx force-pushed the schen/TNL-11876-2 branch 4 times, most recently from e3462b3 to 3351d41 Compare February 5, 2025 01:16
@schenedx
Copy link
Contributor Author

schenedx commented Feb 5, 2025

The bad piece of data on stage is now updated to something that won't result in 500 error. This change is no longer needed. Closing the PR.

@schenedx schenedx closed this Feb 5, 2025
@schenedx schenedx deleted the schen/TNL-11876-2 branch February 5, 2025 16:48
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.

2 participants