prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Show latest feedback in dashboard
  Show admins and content creators the latest feedback from app users in dashboard. This should be a list of the last ~5 messages. In some cases, the feedback only contains a thumbs up or down, in other cases it can contain a message. The title of the page or event concerned should be displayed as well and linked to the editing page.
  
  Additional option: Add link that sends the message string to translate.google.com or deepl.com for translation. This can be useful if the feedback is given in a language the back end user does not understand. It is perfectly fine, if the link opens the translation website in a new tab. No need to fetch a translation via the API.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/cms/views/dashboard/admin_dashboard_view.py`
  Content:
  ```
  1 from django.contrib.auth.decorators import login_required
  2 from django.shortcuts import render
  3 from django.utils.decorators import method_decorator
  4 from django.views.generic import TemplateView
  5 
  6 from ...decorators import staff_required
  7 
  8 
  9 @method_decorator(login_required, name="dispatch")
  10 @method_decorator(staff_required, name="dispatch")
  11 class AdminDashboardView(TemplateView):
  12     """
  13     View for the admin dashboard
  14     """
  15 
  16     #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`)
  17     template_name = "dashboard/admin_dashboard.html"
  18     #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`)
  19     base_context = {"current_menu_item": "admin_dashboard"}
  20 
  21     def get(self, request, *args, **kwargs):
  22         """
  23         Render admin dashboard
  24 
  25         :param request: Object representing the user call
  26         :type request: ~django.http.HttpRequest
  27 
  28         :param args: The supplied arguments
  29         :type args: list
  30 
  31         :param kwargs: The supplied keyword arguments
  32         :type kwargs: dict
  33 
  34         :return: The rendered template response
  35         :rtype: ~django.template.response.TemplateResponse
  36         """
  37 
  38         val = "To be defined"
  39         return render(request, self.template_name, {"key": val, **self.base_context})
  40
  ```
  
  Path: `src/cms/views/dashboard/dashboard_view.py`
  Content:
  ```
  1 import html
  2 from urllib.parse import urlparse
  3 import feedparser
  4 
  5 from django.contrib.auth.decorators import login_required
  6 from django.shortcuts import render
  7 from django.utils import translation
  8 from django.utils.decorators import method_decorator
  9 from django.views.generic import TemplateView
  10 
  11 from backend.settings import RSS_FEED_URLS
  12 from ...decorators import region_permission_required
  13 
  14 
  15 @method_decorator(login_required, name="dispatch")
  16 @method_decorator(region_permission_required, name="dispatch")
  17 class DashboardView(TemplateView):
  18     """
  19     View for the region dashboard
  20     """
  21 
  22     #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`)
  23     template_name = "dashboard/dashboard.html"
  24     #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`)
  25     base_context = {"current_menu_item": "region_dashboard"}
  26 
  27     def get(self, request, *args, **kwargs):
  28         """
  29         Render the region dashboard
  30 
  31         :param request: Object representing the user call
  32         :type request: ~django.http.HttpRequest
  33 
  34         :param args: The supplied arguments
  35         :type args: list
  36 
  37         :param kwargs: The supplied keyword arguments
  38         :type kwargs: dict
  39 
  40         :return: The rendered template response
  41         :rtype: ~django.template.response.TemplateResponse
  42         """
  43 
  44         val = "To be defined"
  45         language_code = translation.get_language()
  46         feed = feedparser.parse(RSS_FEED_URLS[language_code])
  47         # select five most recent feeds
  48         feed["entries"] = feed["entries"][:5]
  49         # decode html entities like dash and split after line break
  50         for entry in feed["entries"]:
  51             entry["summary"] = html.unescape(entry["summary"]).split("\n")[0]
  52         domain = urlparse(RSS_FEED_URLS["home-page"]).netloc
  53         return render(
  54             request,
  55             self.template_name,
  56             {
  57                 "key": val,
  58                 **self.base_context,
  59                 "feed": feed,
  60                 "home_page": RSS_FEED_URLS["home-page"],
  61                 "domain": domain,
  62             },
  63         )
  64
  ```
  --- 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/src/cms/views/dashboard/admin_dashboard_view.py b/src/cms/views/dashboard/admin_dashboard_view.py
  --- a/src/cms/views/dashboard/admin_dashboard_view.py
  +++ b/src/cms/views/dashboard/admin_dashboard_view.py
  @@ -4,6 +4,7 @@
   from django.views.generic import TemplateView
   
   from ...decorators import staff_required
  +from ...models import Feedback
   
   
   @method_decorator(login_required, name="dispatch")
  @@ -34,6 +35,14 @@
           :return: The rendered template response
           :rtype: ~django.template.response.TemplateResponse
           """
  -
  -        val = "To be defined"
  -        return render(request, self.template_name, {"key": val, **self.base_context})
  +        all_feedback = Feedback.objects.filter(is_technical=True)[:5]
  +
  +        return render(
  +            request,
  +            self.template_name,
  +            {
  +                "current_menu_item": "admin_feedback",
  +                "all_feedback": all_feedback,
  +                **self.base_context,
  +            },
  +        )
  diff --git a/src/cms/views/dashboard/dashboard_view.py b/src/cms/views/dashboard/dashboard_view.py
  --- a/src/cms/views/dashboard/dashboard_view.py
  +++ b/src/cms/views/dashboard/dashboard_view.py
  @@ -41,7 +41,6 @@
           :rtype: ~django.template.response.TemplateResponse
           """
   
  -        val = "To be defined"
           language_code = translation.get_language()
           feed = feedparser.parse(RSS_FEED_URLS[language_code])
           # select five most recent feeds
  @@ -54,7 +53,6 @@
               request,
               self.template_name,
               {
  -                "key": val,
                   **self.base_context,
                   "feed": feed,
                   "home_page": RSS_FEED_URLS["home-page"],
  
verification_info: {"golden_diff": "diff --git a/src/cms/views/dashboard/admin_dashboard_view.py b/src/cms/views/dashboard/admin_dashboard_view.py\n--- a/src/cms/views/dashboard/admin_dashboard_view.py\n+++ b/src/cms/views/dashboard/admin_dashboard_view.py\n@@ -4,6 +4,7 @@\n from django.views.generic import TemplateView\n \n from ...decorators import staff_required\n+from ...models import Feedback\n \n \n @method_decorator(login_required, name=\"dispatch\")\n@@ -34,6 +35,14 @@\n         :return: The rendered template response\n         :rtype: ~django.template.response.TemplateResponse\n         \"\"\"\n-\n-        val = \"To be defined\"\n-        return render(request, self.template_name, {\"key\": val, **self.base_context})\n+        all_feedback = Feedback.objects.filter(is_technical=True)[:5]\n+\n+        return render(\n+            request,\n+            self.template_name,\n+            {\n+                \"current_menu_item\": \"admin_feedback\",\n+                \"all_feedback\": all_feedback,\n+                **self.base_context,\n+            },\n+        )\ndiff --git a/src/cms/views/dashboard/dashboard_view.py b/src/cms/views/dashboard/dashboard_view.py\n--- a/src/cms/views/dashboard/dashboard_view.py\n+++ b/src/cms/views/dashboard/dashboard_view.py\n@@ -41,7 +41,6 @@\n         :rtype: ~django.template.response.TemplateResponse\n         \"\"\"\n \n-        val = \"To be defined\"\n         language_code = translation.get_language()\n         feed = feedparser.parse(RSS_FEED_URLS[language_code])\n         # select five most recent feeds\n@@ -54,7 +53,6 @@\n             request,\n             self.template_name,\n             {\n-                \"key\": val,\n                 **self.base_context,\n                 \"feed\": feed,\n                 \"home_page\": RSS_FEED_URLS[\"home-page\"],\n", "issue": "Show latest feedback in dashboard\nShow admins and content creators the latest feedback from app users in dashboard. This should be a list of the last ~5 messages. In some cases, the feedback only contains a thumbs up or down, in other cases it can contain a message. The title of the page or event concerned should be displayed as well and linked to the editing page.\r\n\r\nAdditional option: Add link that sends the message string to translate.google.com or deepl.com for translation. This can be useful if the feedback is given in a language the back end user does not understand. It is perfectly fine, if the link opens the translation website in a new tab. No need to fetch a translation via the API.\n", "before_files": [{"content": "from django.contrib.auth.decorators import login_required\nfrom django.shortcuts import render\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic import TemplateView\n\nfrom ...decorators import staff_required\n\n\n@method_decorator(login_required, name=\"dispatch\")\n@method_decorator(staff_required, name=\"dispatch\")\nclass AdminDashboardView(TemplateView):\n    \"\"\"\n    View for the admin dashboard\n    \"\"\"\n\n    #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`)\n    template_name = \"dashboard/admin_dashboard.html\"\n    #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`)\n    base_context = {\"current_menu_item\": \"admin_dashboard\"}\n\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Render admin dashboard\n\n        :param request: Object representing the user call\n        :type request: ~django.http.HttpRequest\n\n        :param args: The supplied arguments\n        :type args: list\n\n        :param kwargs: The supplied keyword arguments\n        :type kwargs: dict\n\n        :return: The rendered template response\n        :rtype: ~django.template.response.TemplateResponse\n        \"\"\"\n\n        val = \"To be defined\"\n        return render(request, self.template_name, {\"key\": val, **self.base_context})\n", "path": "src/cms/views/dashboard/admin_dashboard_view.py"}, {"content": "import html\nfrom urllib.parse import urlparse\nimport feedparser\n\nfrom django.contrib.auth.decorators import login_required\nfrom django.shortcuts import render\nfrom django.utils import translation\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic import TemplateView\n\nfrom backend.settings import RSS_FEED_URLS\nfrom ...decorators import region_permission_required\n\n\n@method_decorator(login_required, name=\"dispatch\")\n@method_decorator(region_permission_required, name=\"dispatch\")\nclass DashboardView(TemplateView):\n    \"\"\"\n    View for the region dashboard\n    \"\"\"\n\n    #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`)\n    template_name = \"dashboard/dashboard.html\"\n    #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`)\n    base_context = {\"current_menu_item\": \"region_dashboard\"}\n\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Render the region dashboard\n\n        :param request: Object representing the user call\n        :type request: ~django.http.HttpRequest\n\n        :param args: The supplied arguments\n        :type args: list\n\n        :param kwargs: The supplied keyword arguments\n        :type kwargs: dict\n\n        :return: The rendered template response\n        :rtype: ~django.template.response.TemplateResponse\n        \"\"\"\n\n        val = \"To be defined\"\n        language_code = translation.get_language()\n        feed = feedparser.parse(RSS_FEED_URLS[language_code])\n        # select five most recent feeds\n        feed[\"entries\"] = feed[\"entries\"][:5]\n        # decode html entities like dash and split after line break\n        for entry in feed[\"entries\"]:\n            entry[\"summary\"] = html.unescape(entry[\"summary\"]).split(\"\\n\")[0]\n        domain = urlparse(RSS_FEED_URLS[\"home-page\"]).netloc\n        return render(\n            request,\n            self.template_name,\n            {\n                \"key\": val,\n                **self.base_context,\n                \"feed\": feed,\n                \"home_page\": RSS_FEED_URLS[\"home-page\"],\n                \"domain\": domain,\n            },\n        )\n", "path": "src/cms/views/dashboard/dashboard_view.py"}], "after_files": [{"content": "from django.contrib.auth.decorators import login_required\nfrom django.shortcuts import render\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic import TemplateView\n\nfrom ...decorators import staff_required\nfrom ...models import Feedback\n\n\n@method_decorator(login_required, name=\"dispatch\")\n@method_decorator(staff_required, name=\"dispatch\")\nclass AdminDashboardView(TemplateView):\n    \"\"\"\n    View for the admin dashboard\n    \"\"\"\n\n    #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`)\n    template_name = \"dashboard/admin_dashboard.html\"\n    #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`)\n    base_context = {\"current_menu_item\": \"admin_dashboard\"}\n\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Render admin dashboard\n\n        :param request: Object representing the user call\n        :type request: ~django.http.HttpRequest\n\n        :param args: The supplied arguments\n        :type args: list\n\n        :param kwargs: The supplied keyword arguments\n        :type kwargs: dict\n\n        :return: The rendered template response\n        :rtype: ~django.template.response.TemplateResponse\n        \"\"\"\n        all_feedback = Feedback.objects.filter(is_technical=True)[:5]\n\n        return render(\n            request,\n            self.template_name,\n            {\n                \"current_menu_item\": \"admin_feedback\",\n                \"all_feedback\": all_feedback,\n                **self.base_context,\n            },\n        )\n", "path": "src/cms/views/dashboard/admin_dashboard_view.py"}, {"content": "import html\nfrom urllib.parse import urlparse\nimport feedparser\n\nfrom django.contrib.auth.decorators import login_required\nfrom django.shortcuts import render\nfrom django.utils import translation\nfrom django.utils.decorators import method_decorator\nfrom django.views.generic import TemplateView\n\nfrom backend.settings import RSS_FEED_URLS\nfrom ...decorators import region_permission_required\n\n\n@method_decorator(login_required, name=\"dispatch\")\n@method_decorator(region_permission_required, name=\"dispatch\")\nclass DashboardView(TemplateView):\n    \"\"\"\n    View for the region dashboard\n    \"\"\"\n\n    #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`)\n    template_name = \"dashboard/dashboard.html\"\n    #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`)\n    base_context = {\"current_menu_item\": \"region_dashboard\"}\n\n    def get(self, request, *args, **kwargs):\n        \"\"\"\n        Render the region dashboard\n\n        :param request: Object representing the user call\n        :type request: ~django.http.HttpRequest\n\n        :param args: The supplied arguments\n        :type args: list\n\n        :param kwargs: The supplied keyword arguments\n        :type kwargs: dict\n\n        :return: The rendered template response\n        :rtype: ~django.template.response.TemplateResponse\n        \"\"\"\n\n        language_code = translation.get_language()\n        feed = feedparser.parse(RSS_FEED_URLS[language_code])\n        # select five most recent feeds\n        feed[\"entries\"] = feed[\"entries\"][:5]\n        # decode html entities like dash and split after line break\n        for entry in feed[\"entries\"]:\n            entry[\"summary\"] = html.unescape(entry[\"summary\"]).split(\"\\n\")[0]\n        domain = urlparse(RSS_FEED_URLS[\"home-page\"]).netloc\n        return render(\n            request,\n            self.template_name,\n            {\n                **self.base_context,\n                \"feed\": feed,\n                \"home_page\": RSS_FEED_URLS[\"home-page\"],\n                \"domain\": domain,\n            },\n        )\n", "path": "src/cms/views/dashboard/dashboard_view.py"}]}