From b58633c377cd6530feac2e8ba6d26668e4ae9fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Thu, 26 Dec 2019 23:51:52 +0100 Subject: [PATCH] Fix empty search showing tags without bookmarks --- bookmarks/queries.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bookmarks/queries.py b/bookmarks/queries.py index de27a25..1bb8b03 100644 --- a/bookmarks/queries.py +++ b/bookmarks/queries.py @@ -55,6 +55,9 @@ def query_tags(user: User, query_string: str): # Filter for user query_set = query_set.filter(owner=user) + # Only show tags which have bookmarks + query_set = query_set.filter(bookmark__isnull=False) + # Split query into search terms and tags query = _parse_query_string(query_string)