From 3633cfe697605e5bfc39b582dc6944b38717912c Mon Sep 17 00:00:00 2001 From: dsc Date: Sat, 12 Mar 2022 19:17:33 +0200 Subject: [PATCH] no search results message --- yellow/routes.py | 2 ++ yellow/templates/search_results.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/yellow/routes.py b/yellow/routes.py index d72655d..a9a1c87 100644 --- a/yellow/routes.py +++ b/yellow/routes.py @@ -59,6 +59,8 @@ async def search(): users = [u for u in await User.search(needle)] if users: return await render_template('search_results.html', users=users) + else: + return await render_template('search_results.html') users = [u for u in User.select()] return await render_template('search.html', users=users) diff --git a/yellow/templates/search_results.html b/yellow/templates/search_results.html index e8e798a..ad2922f 100644 --- a/yellow/templates/search_results.html +++ b/yellow/templates/search_results.html @@ -12,7 +12,7 @@ Result(s): {{users|length}} {% if not users %} - Nothing found... +
Nothing found... {% else %}
{% for user in users %}