prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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)
  
  
  --- 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/core/views.py`
  Content:
  ```
  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 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/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"}], "after_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 = list(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"}]}