@shadinaif let's reach out to edX about this hack: #210 we did. I think they'll have more to share about the issue. The best way to report a bug is actually to open a pull request and ask for review.
Start the pull request with just:
grades_with_blocks = PersistentSubsectionGrade.objects.select_related('visible_blocks').filter(
- user_id=user_id,
course_id=course_key,
)
and then see if the issue is resolved.
Therefore I'm hacking VisibleBlocks.bulk_create to fix the IntegrityError.
I think the solution is to remove the user_id filter to fix but I wasn't sure.
So we need to report to edX and provide a more suitable solution in _initialize_cache like the following:
grades_with_blocks = PersistentSubsectionGrade.objects.select_related('visible_blocks').filter(
- user_id=user_id,
course_id=course_key,
)
Task: OU-426