We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 820e255 commit 7a80d4eCopy full SHA for 7a80d4e
pgcommitfest/commitfest/views.py
@@ -255,7 +255,11 @@ def global_search(request):
255
return HttpResponseRedirect('/')
256
searchterm = request.GET['searchterm']
257
258
- patches = Patch.objects.select_related().filter(name__icontains=searchterm).order_by('created',)
+ patches = Patch.objects.select_related().filter(name__icontains=searchterm).order_by('created',).all()
259
+
260
+ if len(patches) == 1:
261
+ patch = patches[0]
262
+ return HttpResponseRedirect(f'/patch/{patch.id}/')
263
264
return render(request, 'patchsearch.html', {
265
'patches': patches,
0 commit comments