From 85a8210f5e2d1b5cda5b2f42b97909faa75562c6 Mon Sep 17 00:00:00 2001 From: Allie Signet Date: Mon, 10 May 2021 18:11:28 -0300 Subject: [PATCH] fix rating property on ImportItem --- bookwyrm/models/import_job.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 1b1152abc..c8130af26 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -128,7 +128,9 @@ class ImportItem(models.Model): @property def rating(self): """x/5 star rating for a book""" - return int(self.data["My Rating"]) + if self.data.get("My Rating", None): + return int(self.data["My Rating"]) + return None @property def date_added(self):