Empty search query returned all elements from database

This commit is contained in:
eeintech 2020-09-28 16:34:41 -05:00
parent 9e4a599c44
commit 18e19d7920

View File

@ -18,8 +18,10 @@ InvenTree | {% trans "Search Results" %}
<br><br> <br><br>
<hr> <hr>
{% if query %}
<div id='no-search-results'> <div id='no-search-results'>
<h4><i>{% trans "No results found" %}</i></h4> <h4><i>{% trans "No results found for " %}'{{ query }}'</i></h4>
</div> </div>
{% include "InvenTree/search_part_category.html" with collapse_id="categories" %} {% include "InvenTree/search_part_category.html" with collapse_id="categories" %}
@ -34,6 +36,14 @@ InvenTree | {% trans "Search Results" %}
{% include "InvenTree/search_stock_items.html" with collapse_id="stock" %} {% include "InvenTree/search_stock_items.html" with collapse_id="stock" %}
{% else %}
<div id='empty-search-query'>
<h4><i>{% trans "No results found for " %}'{{ query }}'</i></h4>
</div>
{% endif %}
{% endblock %} {% endblock %}
{% block js_load %} {% block js_load %}