Skip to content
Snippets Groups Projects
Commit 0683dd45 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

bugfix: potential division by zero solved

parent b9865654
No related branches found
No related tags found
No related merge requests found
Pipeline #54038 passed
...@@ -308,9 +308,14 @@ class Task(models.Model): ...@@ -308,9 +308,14 @@ class Task(models.Model):
total_size = total_size + task.size_to_process total_size = total_size + task.size_to_process
finished = {} finished = {}
finished['fraction'] = round((size_archived / (size_remaining + size_archived)) * 100) try:
finished['fraction'] = round((size_archived / (size_remaining + size_archived)) * 100)
except:
finished['fraction'] = -1
finished['total_size'] = total_size finished['total_size'] = total_size
finished['remaining'] = size_remaining finished['remaining'] = size_remaining
return finished return finished
@property @property
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %} {% include 'taskdatabase/pagination.html' %}
</div> </div>
</div> </div>
<p class="footer"> Version 13 July 2023 <p class="footer"> Version 17 July 2023
</div> </div>
{% include 'taskdatabase/refresh.html' %} {% include 'taskdatabase/refresh.html' %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment