refactor responses bool and fix name is_incoming

This commit is contained in:
Cayo Puigdefabregas 2022-01-26 11:31:00 +01:00
parent 2e613265a6
commit 0d166b2b0c
3 changed files with 4 additions and 6 deletions

View File

@ -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):

View File

@ -103,7 +103,7 @@
</a>
<ul id="incoming-lots-nav" class="nav-content collapse" data-bs-parent="#sidebar-nav">
{% for lot in lots %}
{% if lot.is_incominig %}
{% if lot.is_incoming %}
<li>
<a href="{{ url_for('inventory.devices.lotdevicelist', lot_id=lot.id) }}">
<i class="bi bi-circle"></i><span>{{ lot.name }}</span>

View File

@ -12,7 +12,7 @@
{% elif lot.is_temporary %}
<li class="breadcrumb-item active">Temporary Lot</li>
<li class="breadcrumb-item active">{{ lot.name }}</li>
{% elif lot.is_incominig %}
{% elif lot.is_incoming %}
<li class="breadcrumb-item active">Incoming Lot</li>
<li class="breadcrumb-item active">{{ lot.name }}</li>
{% elif lot.is_outgoing %}