Restore old search() code pre-djongo

This commit is contained in:
Andrew Grant committed 2020-05-09 00:17:06 -04:00
1 parent 9f09126388
commit f991a6c1cd
1 file changed
+4 -2
+4 -2
View File
@@ -246,8 +246,10 @@ def search(request):
if request.POST['showdeleted'] == 'False':
tests = tests.exclude(deleted=True)
# keywords = ['(?i)' + f.upper() for f in request.POST['keywords'].split()]
# tests = tests.filter(dev__name__regex=r'{0}'.format('|'.join(keywords)))
tests = tests.order_by('-updated')
keywords = ['(?i)' + f.upper() for f in request.POST['keywords'].split()]
tests = tests.filter(dev__name__regex=r'{0}'.format('|'.join(keywords)))
return render(request, 'search.html', {'tests' : tests})
def user(request, username, page=1):