diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 85735fe97..88a8eab5f 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -112,6 +112,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