prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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
  
  
  
  
  
  </issue>
  <code>
  [start of saleor/search/views.py]
  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 of saleor/search/views.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
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"}]}