From c1397ef5a568cdb63c77aac3a2754ae628674924 Mon Sep 17 00:00:00 2001 From: Skia Date: Thu, 8 Dec 2016 15:30:41 +0100 Subject: [PATCH] Small fix, episode two --- core/views/site.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/views/site.py b/core/views/site.py index aa93fd04..7c376df5 100644 --- a/core/views/site.py +++ b/core/views/site.py @@ -23,7 +23,7 @@ def search_user(query, as_json=False): users = User.objects.filter(Q(first_name__icontains=query) | Q(last_name__icontains=query)).exclude(id__in=exact_nick).exclude(id__in=nicks).all() nicks = nicks[:5] - users = users[:5] + users = users[:50] if as_json: # Re-loads json to avoid double encoding by JsonResponse, but still benefit from serializers exact_nick = json.loads(serializers.serialize('json', exact_nick, fields=('nick_name', 'last_name', 'first_name', 'profile_pict'))) nicks = json.loads(serializers.serialize('json', nicks, fields=('nick_name', 'last_name', 'first_name', 'profile_pict')))