Skip to content

fix: TemplateDoesNotExist Error#192

Merged
irtazaakram merged 7 commits intomainfrom
fix-genex-protex
Mar 10, 2026
Merged

fix: TemplateDoesNotExist Error#192
irtazaakram merged 7 commits intomainfrom
fix-genex-protex

Conversation

@irtazaakram
Copy link
Copy Markdown
Member

This PR fixes an issue where CAPA problem templates were returning a TemplateDoesNotExist error after the recent version update. The root cause was top-level imports of edxval.api in several new video module files (bumper_utils.py, video_transcripts_utils.py, and video.py), which triggered AppRegistryNotReady exceptions during Django's startup phase. These early exceptions caused Open edX to silently abort the CapaAppConfig plugin registration, completely hiding the block's templates directory from the platform. To resolve this, we refactored the problematic top-level imports into lazy-loading helper functions (_get_edxval_api()) that only import the module when executed, ensuring the Django app registry is fully initialized before the models are accessed.

Copy link
Copy Markdown
Contributor

@farhan farhan left a comment

Choose a reason for hiding this comment

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

PR seems alright to me, 1 comment

Comment thread xblocks_contrib/video/video_utils.py Outdated
@irtazaakram irtazaakram requested a review from farhan March 10, 2026 06:19
@irtazaakram irtazaakram merged commit 076c5ee into main Mar 10, 2026
16 of 17 checks passed
@irtazaakram irtazaakram deleted the fix-genex-protex branch March 10, 2026 06:56
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