prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Featured products section should not be shown if there is none
  If there is no featured products, the home page should not show the empty section.
  
  ### Screenshots
  ![screenshot](https://i.imgur.com/KFPEPnz.png)
  
  
  </issue>
  <code>
  [start of saleor/core/views.py]
  1 import json
  2 
  3 from django.contrib import messages
  4 from django.template.response import TemplateResponse
  5 from django.utils.translation import pgettext_lazy
  6 from impersonate.views import impersonate as orig_impersonate
  7 
  8 from ..account.models import User
  9 from ..dashboard.views import staff_member_required
  10 from ..product.utils import products_for_homepage
  11 from ..product.utils.availability import products_with_availability
  12 from ..seo.schema.webpage import get_webpage_schema
  13 
  14 
  15 def home(request):
  16     products = products_for_homepage()[:8]
  17     products = products_with_availability(
  18         products, discounts=request.discounts, taxes=request.taxes,
  19         local_currency=request.currency)
  20     webpage_schema = get_webpage_schema(request)
  21     return TemplateResponse(
  22         request, 'home.html', {
  23             'parent': None,
  24             'products': products,
  25             'webpage_schema': json.dumps(webpage_schema)})
  26 
  27 
  28 @staff_member_required
  29 def styleguide(request):
  30     return TemplateResponse(request, 'styleguide.html')
  31 
  32 
  33 def impersonate(request, uid):
  34     response = orig_impersonate(request, uid)
  35     if request.session.modified:
  36         msg = pgettext_lazy(
  37             'Impersonation message',
  38             'You are now logged as {}'.format(User.objects.get(pk=uid)))
  39         messages.success(request, msg)
  40     return response
  41 
  42 
  43 def handle_404(request, exception=None):
  44     return TemplateResponse(request, '404.html', status=404)
  45 
  46 
  47 def manifest(request):
  48     return TemplateResponse(
  49         request, 'manifest.json', content_type='application/json')
  50
  [end of saleor/core/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/core/views.py b/saleor/core/views.py
  --- a/saleor/core/views.py
  +++ b/saleor/core/views.py
  @@ -14,9 +14,9 @@
   
   def home(request):
       products = products_for_homepage()[:8]
  -    products = products_with_availability(
  +    products = list(products_with_availability(
           products, discounts=request.discounts, taxes=request.taxes,
  -        local_currency=request.currency)
  +        local_currency=request.currency))
       webpage_schema = get_webpage_schema(request)
       return TemplateResponse(
           request, 'home.html', {
  
verification_info: {"golden_diff": "diff --git a/saleor/core/views.py b/saleor/core/views.py\n--- a/saleor/core/views.py\n+++ b/saleor/core/views.py\n@@ -14,9 +14,9 @@\n \n def home(request):\n     products = products_for_homepage()[:8]\n-    products = products_with_availability(\n+    products = list(products_with_availability(\n         products, discounts=request.discounts, taxes=request.taxes,\n-        local_currency=request.currency)\n+        local_currency=request.currency))\n     webpage_schema = get_webpage_schema(request)\n     return TemplateResponse(\n         request, 'home.html', {\n", "issue": "Featured products section should not be shown if there is none\nIf there is no featured products, the home page should not show the empty section.\r\n\r\n### Screenshots\r\n![screenshot](https://i.imgur.com/KFPEPnz.png)\r\n\n", "before_files": [{"content": "import json\n\nfrom django.contrib import messages\nfrom django.template.response import TemplateResponse\nfrom django.utils.translation import pgettext_lazy\nfrom impersonate.views import impersonate as orig_impersonate\n\nfrom ..account.models import User\nfrom ..dashboard.views import staff_member_required\nfrom ..product.utils import products_for_homepage\nfrom ..product.utils.availability import products_with_availability\nfrom ..seo.schema.webpage import get_webpage_schema\n\n\ndef home(request):\n    products = products_for_homepage()[:8]\n    products = products_with_availability(\n        products, discounts=request.discounts, taxes=request.taxes,\n        local_currency=request.currency)\n    webpage_schema = get_webpage_schema(request)\n    return TemplateResponse(\n        request, 'home.html', {\n            'parent': None,\n            'products': products,\n            'webpage_schema': json.dumps(webpage_schema)})\n\n\n@staff_member_required\ndef styleguide(request):\n    return TemplateResponse(request, 'styleguide.html')\n\n\ndef impersonate(request, uid):\n    response = orig_impersonate(request, uid)\n    if request.session.modified:\n        msg = pgettext_lazy(\n            'Impersonation message',\n            'You are now logged as {}'.format(User.objects.get(pk=uid)))\n        messages.success(request, msg)\n    return response\n\n\ndef handle_404(request, exception=None):\n    return TemplateResponse(request, '404.html', status=404)\n\n\ndef manifest(request):\n    return TemplateResponse(\n        request, 'manifest.json', content_type='application/json')\n", "path": "saleor/core/views.py"}]}