From 47c4086766e9373637306fb4c664f136f4f4d36b Mon Sep 17 00:00:00 2001 From: bashmak Date: Mon, 2 Jul 2018 12:05:21 +0300 Subject: [PATCH] Fix search --- abonapp/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/abonapp/views.py b/abonapp/views.py index a2ed3fe..2c4e9f7 100644 --- a/abonapp/views.py +++ b/abonapp/views.py @@ -1165,8 +1165,7 @@ def search_abon(request): if not word: return None results = models.Abon.objects.filter(fio__icontains=word)[:8] - results = ({'id': usr.pk, 'text': "%s: %s" % (usr.username, usr.fio)} for usr in results) - return results + return list({'id': usr.pk, 'text': "%s: %s" % (usr.username, usr.fio)} for usr in results) class DhcpLever(SecureApiView):