From aea8fa0f6fe49fa8c0455f337fd31e82deb577ca Mon Sep 17 00:00:00 2001 From: Alexander Kondratyev Date: Sat, 25 Mar 2017 14:46:44 +0300 Subject: [PATCH] Limit for expired tm loading - fix too long query --- trademark/landing/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trademark/landing/api.py b/trademark/landing/api.py index 17eb139..4b85982 100644 --- a/trademark/landing/api.py +++ b/trademark/landing/api.py @@ -103,7 +103,7 @@ def get_random_list_trademarks(request, status='Expired', count=10): notation = '' trademark_list = [] - expired_trademarks = Trademark.objects.filter(status=status).order_by('?') + expired_trademarks = Trademark.objects.filter(status=status).order_by('?')[:50] random_list = _get_random_list(expired_trademarks)[:count*2] for trademark in random_list: