From 6fca974f047ce22e0e5f8ad5eb6ba02550ab2fae Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 26 Jan 2022 11:34:35 +0100 Subject: [PATCH] bool refactor in lot module --- ereuse_devicehub/resources/lot/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/resources/lot/models.py b/ereuse_devicehub/resources/lot/models.py index 991e71b9..88c68626 100644 --- a/ereuse_devicehub/resources/lot/models.py +++ b/ereuse_devicehub/resources/lot/models.py @@ -102,7 +102,7 @@ class Lot(Thing): @property def is_temporary(self): - return False if self.trade else True + return not bool(self.trade) @property def is_incoming(self): @@ -110,9 +110,7 @@ class Lot(Thing): @property def is_outgoing(self): - if self.trade and self.trade.user_from == current_user: - return True - return False + return bool(self.trade and self.trade.user_from == current_user) @classmethod def descendantsq(cls, id):