fix rating property on ImportItem

This commit is contained in:
Allie Signet 2021-05-10 18:11:28 -03:00
parent 711772046f
commit 85a8210f5e

View file

@ -128,7 +128,9 @@ class ImportItem(models.Model):
@property @property
def rating(self): def rating(self):
"""x/5 star rating for a book""" """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 @property
def date_added(self): def date_added(self):