From e5b346e7fa778294d15a5a30354eb1dbae8fcead Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 6 Jan 2021 23:09:26 +1100 Subject: [PATCH] PEP fixes --- InvenTree/common/models.py | 6 ++++-- InvenTree/stock/models.py | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 5651a401de..5c04f9a7e9 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -566,10 +566,12 @@ class InvenTreeSetting(models.Model): """ try: - value = int() + value = int(self.value) except (ValueError, TypeError): - return self.default_value() + value = self.default_value() + return value + class PriceBreak(models.Model): """ diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 533aca7596..d399c0daf1 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -501,7 +501,6 @@ class StockItem(MPTTModel): return self.expiry_date < expiry_date - def is_expired(self): """ Returns True if this StockItem is "expired".