mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 16:40:36 +00:00
Avoid divide by zero error
This commit is contained in:
parent
3c2f2c10bf
commit
9cfcad20e0
1 changed files with 2 additions and 0 deletions
|
@ -58,6 +58,8 @@ class ImportJob(models.Model):
|
|||
def percent_complete(self):
|
||||
"""How far along?"""
|
||||
item_count = self.item_count
|
||||
if not item_count:
|
||||
return 0
|
||||
return math.floor((item_count - self.pending_item_count) / item_count * 100)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue