We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Project template needs updating for search promotions changes
The provided view still references the EditorsPick model: https://github.com/torchbox/wagtail/blob/master/wagtail/project_template/search/views.py#L5

Shall we update this to use the new contrib module or remove it completely?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `wagtail/project_template/search/views.py`
Content:
```
1 from django.shortcuts import render
2 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
3 
4 from wagtail.wagtailcore.models import Page
5 from wagtail.wagtailsearch.models import Query, EditorsPick
6 
7 
8 def search(request):
9     search_query = request.GET.get('query', None)
10     page = request.GET.get('page', 1)
11 
12     # Search
13     if search_query:
14         search_results = Page.objects.live().search(search_query)
15         query = Query.get(search_query)
16 
17         # Record hit
18         query.add_hit()
19 
20         # Get search picks
21         search_picks = query.editors_picks.all()
22     else:
23         search_results = Page.objects.none()
24         search_picks = EditorsPick.objects.none()
25 
26     # Pagination
27     paginator = Paginator(search_results, 10)
28     try:
29         search_results = paginator.page(page)
30     except PageNotAnInteger:
31         search_results = paginator.page(1)
32     except EmptyPage:
33         search_results = paginator.page(paginator.num_pages)
34 
35     return render(request, 'search/search.html', {
36         'search_query': search_query,
37         'search_results': search_results,
38         'search_picks': search_picks,
39     })
40
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/wagtail/project_template/search/views.py b/wagtail/project_template/search/views.py
--- a/wagtail/project_template/search/views.py
+++ b/wagtail/project_template/search/views.py
@@ -2,7 +2,7 @@
 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
 
 from wagtail.wagtailcore.models import Page
-from wagtail.wagtailsearch.models import Query, EditorsPick
+from wagtail.wagtailsearch.models import Query
 
 
 def search(request):
@@ -16,12 +16,8 @@
 
         # Record hit
         query.add_hit()
-
-        # Get search picks
-        search_picks = query.editors_picks.all()
     else:
         search_results = Page.objects.none()
-        search_picks = EditorsPick.objects.none()
 
     # Pagination
     paginator = Paginator(search_results, 10)
@@ -35,5 +31,4 @@
     return render(request, 'search/search.html', {
         'search_query': search_query,
         'search_results': search_results,
-        'search_picks': search_picks,
     })

{"golden_diff": "diff --git a/wagtail/project_template/search/views.py b/wagtail/project_template/search/views.py\n--- a/wagtail/project_template/search/views.py\n+++ b/wagtail/project_template/search/views.py\n@@ -2,7 +2,7 @@\n from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger\n \n from wagtail.wagtailcore.models import Page\n-from wagtail.wagtailsearch.models import Query, EditorsPick\n+from wagtail.wagtailsearch.models import Query\n \n \n def search(request):\n@@ -16,12 +16,8 @@\n \n         # Record hit\n         query.add_hit()\n-\n-        # Get search picks\n-        search_picks = query.editors_picks.all()\n     else:\n         search_results = Page.objects.none()\n-        search_picks = EditorsPick.objects.none()\n \n     # Pagination\n     paginator = Paginator(search_results, 10)\n@@ -35,5 +31,4 @@\n     return render(request, 'search/search.html', {\n         'search_query': search_query,\n         'search_results': search_results,\n-        'search_picks': search_picks,\n     })\n", "issue": "Project template needs updating for search promotions changes\nThe provided view still references the EditorsPick model: https://github.com/torchbox/wagtail/blob/master/wagtail/project_template/search/views.py#L5\n\nShall we update this to use the new contrib module or remove it completely?\n\n", "before_files": [{"content": "from django.shortcuts import render\nfrom django.core.paginator import Paginator, EmptyPage, PageNotAnInteger\n\nfrom wagtail.wagtailcore.models import Page\nfrom wagtail.wagtailsearch.models import Query, EditorsPick\n\n\ndef search(request):\n    search_query = request.GET.get('query', None)\n    page = request.GET.get('page', 1)\n\n    # Search\n    if search_query:\n        search_results = Page.objects.live().search(search_query)\n        query = Query.get(search_query)\n\n        # Record hit\n        query.add_hit()\n\n        # Get search picks\n        search_picks = query.editors_picks.all()\n    else:\n        search_results = Page.objects.none()\n        search_picks = EditorsPick.objects.none()\n\n    # Pagination\n    paginator = Paginator(search_results, 10)\n    try:\n        search_results = paginator.page(page)\n    except PageNotAnInteger:\n        search_results = paginator.page(1)\n    except EmptyPage:\n        search_results = paginator.page(paginator.num_pages)\n\n    return render(request, 'search/search.html', {\n        'search_query': search_query,\n        'search_results': search_results,\n        'search_picks': search_picks,\n    })\n", "path": "wagtail/project_template/search/views.py"}], "after_files": [{"content": "from django.shortcuts import render\nfrom django.core.paginator import Paginator, EmptyPage, PageNotAnInteger\n\nfrom wagtail.wagtailcore.models import Page\nfrom wagtail.wagtailsearch.models import Query\n\n\ndef search(request):\n    search_query = request.GET.get('query', None)\n    page = request.GET.get('page', 1)\n\n    # Search\n    if search_query:\n        search_results = Page.objects.live().search(search_query)\n        query = Query.get(search_query)\n\n        # Record hit\n        query.add_hit()\n    else:\n        search_results = Page.objects.none()\n\n    # Pagination\n    paginator = Paginator(search_results, 10)\n    try:\n        search_results = paginator.page(page)\n    except PageNotAnInteger:\n        search_results = paginator.page(1)\n    except EmptyPage:\n        search_results = paginator.page(paginator.num_pages)\n\n    return render(request, 'search/search.html', {\n        'search_query': search_query,\n        'search_results': search_results,\n    })\n", "path": "wagtail/project_template/search/views.py"}]}