Fix: Don't import all the problem builder blocks when the django app is loaded - #71
Merged
Merged
Conversation
bradenmacdonald
force-pushed
the
fix-sub_api-load-issue-oc-1003
branch
from
October 10, 2015 06:49
83549dd to
55e1e83
Compare
bradenmacdonald
force-pushed
the
fix-sub_api-load-issue-oc-1003
branch
from
October 10, 2015 07:06
55e1e83 to
7263e34
Compare
Member
|
It seem like a good approach given the explanations you've put in the description, and a relatively straightforward change. I'm only with a tablet now so I can't test the change - I'll see if someone else from the team can take care of it tomorrow morning. 👍 once this has been tested. |
Member
|
👍 |
|
I'm good with this approach. The imports in |
bradenmacdonald
added a commit
that referenced
this pull request
Oct 13, 2015
Fix: Don't import all the problem builder blocks when the django app is loaded
This was referenced Oct 13, 2015
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.