call one time all lots

This commit is contained in:
Cayo Puigdefabregas 2022-07-05 18:10:17 +02:00
parent bc8944a498
commit 3a06ade79f
2 changed files with 4 additions and 3 deletions

View File

@ -179,7 +179,7 @@
{% else %}
<ul id="incoming-lots-nav" class="nav-content collapse" data-bs-parent="#sidebar-nav">
{% endif %}
{% for lot in lots %}
{% for lot in all_lots %}
{% if lot.is_incoming %}
<li>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
@ -204,7 +204,7 @@
{% else %}
<ul id="outgoing-lots-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav">
{% endif %}
{% for lot in lots %}
{% for lot in all_lots %}
{% if lot.is_outgoing %}
<li>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">
@ -235,7 +235,7 @@
<i class="bi bi-plus" style="font-size: larger;"></i><span>New temporary lot</span>
</a>
</li>
{% for lot in lots %}
{% for lot in all_lots %}
{% if lot.is_temporary %}
<li>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}">

View File

@ -69,6 +69,7 @@ class GenericMixin(View):
def get_context(self):
self.context = {
'lots': self.get_lots(),
'all_lots': self.get_lots().all(),
'version': __version__,
}