From 0d166b2b0c9f766792398087eb2b7872b748ee1a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 26 Jan 2022 11:31:00 +0100 Subject: [PATCH] refactor responses bool and fix name is_incoming --- ereuse_devicehub/resources/lot/models.py | 6 ++---- ereuse_devicehub/templates/ereuse_devicehub/base_site.html | 2 +- ereuse_devicehub/templates/inventory/device_list.html | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ereuse_devicehub/resources/lot/models.py b/ereuse_devicehub/resources/lot/models.py index 8833412c..991e71b9 100644 --- a/ereuse_devicehub/resources/lot/models.py +++ b/ereuse_devicehub/resources/lot/models.py @@ -105,10 +105,8 @@ class Lot(Thing): return False if self.trade else True @property - def is_incominig(self): - if self.trade and self.trade.user_to == current_user: - return True - return False + def is_incoming(self): + return bool(self.trade and self.trade.user_to == current_user) @property def is_outgoing(self): diff --git a/ereuse_devicehub/templates/ereuse_devicehub/base_site.html b/ereuse_devicehub/templates/ereuse_devicehub/base_site.html index 94f78723..11f1850e 100644 --- a/ereuse_devicehub/templates/ereuse_devicehub/base_site.html +++ b/ereuse_devicehub/templates/ereuse_devicehub/base_site.html @@ -103,7 +103,7 @@