Skip to content

Commit

Permalink
Fix progress handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bjester committed Jul 29, 2021
1 parent 586cd0d commit ccf2795
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions kolibri/core/auth/management/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,15 @@ def handler(transfer_session):
"""
:type transfer_session: morango.models.core.TransferSession
"""
progress = (
100
* transfer_session.records_transferred
/ float(transfer_session.records_total)
)
if transfer_session.records_total > 0:
progress = (
100
* transfer_session.records_transferred
/ float(transfer_session.records_total)
)
else:
progress = 100

tracker.update_progress(
increment=math.ceil(progress - tracker.progress),
message=stats_msg(transfer_session),
Expand Down

0 comments on commit ccf2795

Please sign in to comment.