-
Notifications
You must be signed in to change notification settings - Fork 303
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
Languagepack progress bar fix #4998
Languagepack progress bar fix #4998
Conversation
It's tied to the management command that backs it -- the UpdateProgressLog model which backs this app creates a process_name attribute based on the invoked management command, which in this case changed from languagepackdownload to retrievecontentpack.
Tested. Working. Merging. |
Also, are you planning to write tests for this? |
Yes For tests, I'm hesitant -- the language pack list depends AFAICT on external variables, namely the central server. So it's not super isolated. The rest of the functionality depends on the list. I would like to assert that the download bar appears or something, but if it breaks when the central server is offline or when factors outside of this app change, it's brittle. Your thoughts? |
I concur. If you can think of a way to isolate this functionality with a unit test, then try mocking or using vcr.py. Otherwise, merge at will. |
Languagepack progress bar fix
I just pulled and make sure the changes are present. But I didn't see the progress bar when downloading language pack (Spain). Did I miss anything? @MCGallaspy @aronasorman |
@66eli77 maybe so... worked for me, seems to have worked for @aronasorman. Perhaps you didn't rebuild the javascript bundles? |
could it be that I started a language pack download process before the code change, and I stop the server and git pull the changes, and do the download again? |
I just pulled latest 0.16 and can confirm that the progress bar is present. @66eli77 try rebuilding as @MCGallaspy mentioned. |
Summary
Fixes #4955. But while looking in to this I went down a dead end with the updates management command base classes: https://github.com/learningequality/ka-lite/blob/0.16.x/kalite/updates/management/commands/classes.py#L41
As far as I can tell, it's not possible to pass kwargs to a command's constructor using the
call_command
function (or possibly at all). For instance, it doesn't seem possible to set theprocess_name
, which was the first thing I attempted. Instead changes to the back-end (like in this case changing the management command that's being called) require changes to the front-end. Is this worth a refactor?TODO
Test incoming.
Issues addressed
Fixes #4955.