Skip to content

Commit

Permalink
Hack: use the API that the new update_progress command expects.
Browse files Browse the repository at this point in the history
  • Loading branch information
aronasorman committed Jun 14, 2017
1 parent 2cd7647 commit 83bb1ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kolibri/tasks/management/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def __init__(self, *args, **kwargs):
def _update_all_progress(self, progress_fraction, progress):
if callable(self.update_progress):
progress_list = [p.get_progress() for p in self.progresstrackers]
self.update_progress(progress_list[0].progress_fraction, progress_list)
# HACK (aron): self.update_progress' signature has changed between django_q
# and iceqube/bbq. It now expects the current progress,
# the total progress, and then derives the
# percentage progress manually.
self.update_progress(progress_list[0].progress_fraction, 1.)

def handle(self, *args, **options):
self.update_progress = options.pop("update_progress", None)
Expand Down

0 comments on commit 83bb1ba

Please sign in to comment.