Fix: Don't import all the problem builder blocks when the django app is loaded #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OC-1003
This fixes TNL-3563.
The
pb-dashboardblock was not loading due to a bizarre combination of factors, brought into play by the recent django-rest-framework upgrade.Details:
The error was being reported as:
To get the true error, I had to remove a
try: ... except ImportErrorwrapper, and then we can see the real cause:Essentially, two django apps (
cms.djangoapps.contentstoreandrest_framework) are callingugettext()at import time (i.e. when the CMS starts up), and as you can see in the trace above, this leads to a circular import of the edx-submissions API.Fix:
A complete fix would probably involve changing
ugettexttougettext_lazyin any import-time code of all django apps used by the platform, but that is an involved undertaking and can lead to subtle bugs.So I have worked around the issue by fixing problem-builder so it doesn't load
dashboard.pywhen imported as a django app (which was not necessary). This does change the import path for the XBlock, but I'm not aware of any third party code that would be using that import.