prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  no_query_found method is missing.
  Hello,
  the user gets an error if he submits the search form without a query.
  There is not "no_query_found" method inside SearchForm.
  
  https://github.com/mirumee/saleor/blob/35956e20a85b66abc95e08491f38fa69d74d5f12/saleor/search/views.py#L28
  
  
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `saleor/search/views.py`
  Content:
  ```
  1 from __future__ import unicode_literals
  2 
  3 from django.core.paginator import Paginator, InvalidPage
  4 from django.conf import settings
  5 from django.http import Http404
  6 from django.shortcuts import render
  7 from .forms import SearchForm
  8 from ..product.utils import products_with_details
  9 
  10 
  11 def paginate_results(results, get_data, paginate_by=25):
  12     paginator = Paginator(results, paginate_by)
  13     page_number = get_data.get('page', 1)
  14     try:
  15         page = paginator.page(page_number)
  16     except InvalidPage:
  17         raise Http404('No such page!')
  18     return page
  19 
  20 
  21 def search(request):
  22     form = SearchForm(data=request.GET or None)
  23     if form.is_valid():
  24         visible_products = products_with_details(request.user)
  25         results = form.search(model_or_queryset=visible_products)
  26         page = paginate_results(results, request.GET, settings.PAGINATE_BY)
  27     else:
  28         page = form.no_query_found()
  29     query = form.cleaned_data['q']
  30     ctx = {
  31         'query': query,
  32         'results': page,
  33         'query_string': '?q=%s' % query}
  34     return render(request, 'search/results.html', ctx)
  35
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/saleor/search/views.py b/saleor/search/views.py
  --- a/saleor/search/views.py
  +++ b/saleor/search/views.py
  @@ -23,10 +23,11 @@
       if form.is_valid():
           visible_products = products_with_details(request.user)
           results = form.search(model_or_queryset=visible_products)
  -        page = paginate_results(results, request.GET, settings.PAGINATE_BY)
  +        query = form.cleaned_data.get('q', '')
       else:
  -        page = form.no_query_found()
  -    query = form.cleaned_data['q']
  +        results = []
  +        query = ''
  +    page = paginate_results(results, request.GET, settings.PAGINATE_BY)
       ctx = {
           'query': query,
           'results': page,
  
verification_info: {"golden_diff": "diff --git a/saleor/search/views.py b/saleor/search/views.py\n--- a/saleor/search/views.py\n+++ b/saleor/search/views.py\n@@ -23,10 +23,11 @@\n     if form.is_valid():\n         visible_products = products_with_details(request.user)\n         results = form.search(model_or_queryset=visible_products)\n-        page = paginate_results(results, request.GET, settings.PAGINATE_BY)\n+        query = form.cleaned_data.get('q', '')\n     else:\n-        page = form.no_query_found()\n-    query = form.cleaned_data['q']\n+        results = []\n+        query = ''\n+    page = paginate_results(results, request.GET, settings.PAGINATE_BY)\n     ctx = {\n         'query': query,\n         'results': page,\n", "issue": "no_query_found method is missing.\nHello,\r\nthe user gets an error if he submits the search form without a query.\r\nThere is not \"no_query_found\" method inside SearchForm.\r\n\r\nhttps://github.com/mirumee/saleor/blob/35956e20a85b66abc95e08491f38fa69d74d5f12/saleor/search/views.py#L28\r\n\r\n\r\n\r\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nfrom django.core.paginator import Paginator, InvalidPage\nfrom django.conf import settings\nfrom django.http import Http404\nfrom django.shortcuts import render\nfrom .forms import SearchForm\nfrom ..product.utils import products_with_details\n\n\ndef paginate_results(results, get_data, paginate_by=25):\n    paginator = Paginator(results, paginate_by)\n    page_number = get_data.get('page', 1)\n    try:\n        page = paginator.page(page_number)\n    except InvalidPage:\n        raise Http404('No such page!')\n    return page\n\n\ndef search(request):\n    form = SearchForm(data=request.GET or None)\n    if form.is_valid():\n        visible_products = products_with_details(request.user)\n        results = form.search(model_or_queryset=visible_products)\n        page = paginate_results(results, request.GET, settings.PAGINATE_BY)\n    else:\n        page = form.no_query_found()\n    query = form.cleaned_data['q']\n    ctx = {\n        'query': query,\n        'results': page,\n        'query_string': '?q=%s' % query}\n    return render(request, 'search/results.html', ctx)\n", "path": "saleor/search/views.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nfrom django.core.paginator import Paginator, InvalidPage\nfrom django.conf import settings\nfrom django.http import Http404\nfrom django.shortcuts import render\nfrom .forms import SearchForm\nfrom ..product.utils import products_with_details\n\n\ndef paginate_results(results, get_data, paginate_by=25):\n    paginator = Paginator(results, paginate_by)\n    page_number = get_data.get('page', 1)\n    try:\n        page = paginator.page(page_number)\n    except InvalidPage:\n        raise Http404('No such page!')\n    return page\n\n\ndef search(request):\n    form = SearchForm(data=request.GET or None)\n    if form.is_valid():\n        visible_products = products_with_details(request.user)\n        results = form.search(model_or_queryset=visible_products)\n        query = form.cleaned_data.get('q', '')\n    else:\n        results = []\n        query = ''\n    page = paginate_results(results, request.GET, settings.PAGINATE_BY)\n    ctx = {\n        'query': query,\n        'results': page,\n        'query_string': '?q=%s' % query}\n    return render(request, 'search/results.html', ctx)\n", "path": "saleor/search/views.py"}]}