prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Vacancy detail view in API does not work
  ### Describe the bug
  The API detail view for vacancies seem to be broken. 
  
  ### How to reproduce
  Steps to reproduce the behaviour:
  1. Go to `/api/v2/partners/vacancies/1/`
  2. Crash!
  
  ### Expected behaviour
  Should work.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `website/partners/api/v2/views.py`
  Content:
  ```
  1 from django.db.models import query
  2 from oauth2_provider.contrib.rest_framework import IsAuthenticatedOrTokenHasScope
  3 from rest_framework import filters as framework_filters
  4 from rest_framework.generics import ListAPIView, RetrieveAPIView
  5 
  6 from partners.api.v2 import filters
  7 from partners.api.v2.serializers.partner import PartnerSerializer
  8 from partners.api.v2.serializers.partner_event import PartnerEventSerializer
  9 from partners.api.v2.serializers.vacancy import VacancySerializer
  10 from partners.models import PartnerEvent, Partner, Vacancy
  11 
  12 
  13 class PartnerEventListView(ListAPIView):
  14     """Returns an overview of all partner events."""
  15 
  16     serializer_class = PartnerEventSerializer
  17     queryset = PartnerEvent.objects.filter(published=True)
  18     filter_backends = (
  19         framework_filters.OrderingFilter,
  20         framework_filters.SearchFilter,
  21         filters.PartnerEventDateFilter,
  22     )
  23     ordering_fields = ("start", "end", "title")
  24     search_fields = ("title",)
  25     permission_classes = [IsAuthenticatedOrTokenHasScope]
  26     required_scopes = ["partners:read"]
  27 
  28 
  29 class PartnerEventDetailView(RetrieveAPIView):
  30     """Returns a single partner event."""
  31 
  32     serializer_class = PartnerEventSerializer
  33     queryset = PartnerEvent.objects.filter(published=True)
  34     permission_classes = [IsAuthenticatedOrTokenHasScope]
  35     required_scopes = ["partners:read"]
  36 
  37 
  38 class PartnerListView(ListAPIView):
  39     """Returns an overview of all partners."""
  40 
  41     serializer_class = PartnerSerializer
  42     queryset = Partner.objects.filter(is_active=True)
  43     filter_backends = (
  44         framework_filters.OrderingFilter,
  45         framework_filters.SearchFilter,
  46     )
  47     ordering_fields = ("name", "pk")
  48     search_fields = ("name",)
  49     permission_classes = [IsAuthenticatedOrTokenHasScope]
  50     required_scopes = ["partners:read"]
  51 
  52 
  53 class PartnerDetailView(RetrieveAPIView):
  54     """Returns a single partner."""
  55 
  56     serializer_class = PartnerSerializer
  57     queryset = Partner.objects.filter(is_active=True)
  58     permission_classes = [IsAuthenticatedOrTokenHasScope]
  59     required_scopes = ["partners:read"]
  60 
  61 
  62 class VacancyListView(ListAPIView):
  63     """Returns an overview of all vacancies."""
  64 
  65     serializer_class = VacancySerializer
  66     queryset = Vacancy.objects.all()
  67     filter_backends = (
  68         framework_filters.OrderingFilter,
  69         framework_filters.SearchFilter,
  70         filters.VacancyPartnerFilter,
  71     )
  72     ordering_fields = ("title", "pk")
  73     search_fields = (
  74         "title",
  75         "company_name",
  76     )
  77     permission_classes = [IsAuthenticatedOrTokenHasScope]
  78     required_scopes = ["partners:read"]
  79 
  80 
  81 class VacancyDetailView(RetrieveAPIView):
  82     """Returns a single vacancy."""
  83 
  84     serializer_class = VacancySerializer
  85     queryset = Partner.objects.all()
  86     permission_classes = [IsAuthenticatedOrTokenHasScope]
  87     required_scopes = ["partners:read"]
  88
  ```
  --- 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/website/partners/api/v2/views.py b/website/partners/api/v2/views.py
  --- a/website/partners/api/v2/views.py
  +++ b/website/partners/api/v2/views.py
  @@ -1,4 +1,3 @@
  -from django.db.models import query
   from oauth2_provider.contrib.rest_framework import IsAuthenticatedOrTokenHasScope
   from rest_framework import filters as framework_filters
   from rest_framework.generics import ListAPIView, RetrieveAPIView
  @@ -82,6 +81,6 @@
       """Returns a single vacancy."""
   
       serializer_class = VacancySerializer
  -    queryset = Partner.objects.all()
  +    queryset = Vacancy.objects.all()
       permission_classes = [IsAuthenticatedOrTokenHasScope]
       required_scopes = ["partners:read"]
  
verification_info: {"golden_diff": "diff --git a/website/partners/api/v2/views.py b/website/partners/api/v2/views.py\n--- a/website/partners/api/v2/views.py\n+++ b/website/partners/api/v2/views.py\n@@ -1,4 +1,3 @@\n-from django.db.models import query\n from oauth2_provider.contrib.rest_framework import IsAuthenticatedOrTokenHasScope\n from rest_framework import filters as framework_filters\n from rest_framework.generics import ListAPIView, RetrieveAPIView\n@@ -82,6 +81,6 @@\n     \"\"\"Returns a single vacancy.\"\"\"\n \n     serializer_class = VacancySerializer\n-    queryset = Partner.objects.all()\n+    queryset = Vacancy.objects.all()\n     permission_classes = [IsAuthenticatedOrTokenHasScope]\n     required_scopes = [\"partners:read\"]\n", "issue": "Vacancy detail view in API does not work\n### Describe the bug\r\nThe API detail view for vacancies seem to be broken. \r\n\r\n### How to reproduce\r\nSteps to reproduce the behaviour:\r\n1. Go to `/api/v2/partners/vacancies/1/`\r\n2. Crash!\r\n\r\n### Expected behaviour\r\nShould work.\r\n\n", "before_files": [{"content": "from django.db.models import query\nfrom oauth2_provider.contrib.rest_framework import IsAuthenticatedOrTokenHasScope\nfrom rest_framework import filters as framework_filters\nfrom rest_framework.generics import ListAPIView, RetrieveAPIView\n\nfrom partners.api.v2 import filters\nfrom partners.api.v2.serializers.partner import PartnerSerializer\nfrom partners.api.v2.serializers.partner_event import PartnerEventSerializer\nfrom partners.api.v2.serializers.vacancy import VacancySerializer\nfrom partners.models import PartnerEvent, Partner, Vacancy\n\n\nclass PartnerEventListView(ListAPIView):\n    \"\"\"Returns an overview of all partner events.\"\"\"\n\n    serializer_class = PartnerEventSerializer\n    queryset = PartnerEvent.objects.filter(published=True)\n    filter_backends = (\n        framework_filters.OrderingFilter,\n        framework_filters.SearchFilter,\n        filters.PartnerEventDateFilter,\n    )\n    ordering_fields = (\"start\", \"end\", \"title\")\n    search_fields = (\"title\",)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass PartnerEventDetailView(RetrieveAPIView):\n    \"\"\"Returns a single partner event.\"\"\"\n\n    serializer_class = PartnerEventSerializer\n    queryset = PartnerEvent.objects.filter(published=True)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass PartnerListView(ListAPIView):\n    \"\"\"Returns an overview of all partners.\"\"\"\n\n    serializer_class = PartnerSerializer\n    queryset = Partner.objects.filter(is_active=True)\n    filter_backends = (\n        framework_filters.OrderingFilter,\n        framework_filters.SearchFilter,\n    )\n    ordering_fields = (\"name\", \"pk\")\n    search_fields = (\"name\",)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass PartnerDetailView(RetrieveAPIView):\n    \"\"\"Returns a single partner.\"\"\"\n\n    serializer_class = PartnerSerializer\n    queryset = Partner.objects.filter(is_active=True)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass VacancyListView(ListAPIView):\n    \"\"\"Returns an overview of all vacancies.\"\"\"\n\n    serializer_class = VacancySerializer\n    queryset = Vacancy.objects.all()\n    filter_backends = (\n        framework_filters.OrderingFilter,\n        framework_filters.SearchFilter,\n        filters.VacancyPartnerFilter,\n    )\n    ordering_fields = (\"title\", \"pk\")\n    search_fields = (\n        \"title\",\n        \"company_name\",\n    )\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass VacancyDetailView(RetrieveAPIView):\n    \"\"\"Returns a single vacancy.\"\"\"\n\n    serializer_class = VacancySerializer\n    queryset = Partner.objects.all()\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n", "path": "website/partners/api/v2/views.py"}], "after_files": [{"content": "from oauth2_provider.contrib.rest_framework import IsAuthenticatedOrTokenHasScope\nfrom rest_framework import filters as framework_filters\nfrom rest_framework.generics import ListAPIView, RetrieveAPIView\n\nfrom partners.api.v2 import filters\nfrom partners.api.v2.serializers.partner import PartnerSerializer\nfrom partners.api.v2.serializers.partner_event import PartnerEventSerializer\nfrom partners.api.v2.serializers.vacancy import VacancySerializer\nfrom partners.models import PartnerEvent, Partner, Vacancy\n\n\nclass PartnerEventListView(ListAPIView):\n    \"\"\"Returns an overview of all partner events.\"\"\"\n\n    serializer_class = PartnerEventSerializer\n    queryset = PartnerEvent.objects.filter(published=True)\n    filter_backends = (\n        framework_filters.OrderingFilter,\n        framework_filters.SearchFilter,\n        filters.PartnerEventDateFilter,\n    )\n    ordering_fields = (\"start\", \"end\", \"title\")\n    search_fields = (\"title\",)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass PartnerEventDetailView(RetrieveAPIView):\n    \"\"\"Returns a single partner event.\"\"\"\n\n    serializer_class = PartnerEventSerializer\n    queryset = PartnerEvent.objects.filter(published=True)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass PartnerListView(ListAPIView):\n    \"\"\"Returns an overview of all partners.\"\"\"\n\n    serializer_class = PartnerSerializer\n    queryset = Partner.objects.filter(is_active=True)\n    filter_backends = (\n        framework_filters.OrderingFilter,\n        framework_filters.SearchFilter,\n    )\n    ordering_fields = (\"name\", \"pk\")\n    search_fields = (\"name\",)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass PartnerDetailView(RetrieveAPIView):\n    \"\"\"Returns a single partner.\"\"\"\n\n    serializer_class = PartnerSerializer\n    queryset = Partner.objects.filter(is_active=True)\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass VacancyListView(ListAPIView):\n    \"\"\"Returns an overview of all vacancies.\"\"\"\n\n    serializer_class = VacancySerializer\n    queryset = Vacancy.objects.all()\n    filter_backends = (\n        framework_filters.OrderingFilter,\n        framework_filters.SearchFilter,\n        filters.VacancyPartnerFilter,\n    )\n    ordering_fields = (\"title\", \"pk\")\n    search_fields = (\n        \"title\",\n        \"company_name\",\n    )\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n\n\nclass VacancyDetailView(RetrieveAPIView):\n    \"\"\"Returns a single vacancy.\"\"\"\n\n    serializer_class = VacancySerializer\n    queryset = Vacancy.objects.all()\n    permission_classes = [IsAuthenticatedOrTokenHasScope]\n    required_scopes = [\"partners:read\"]\n", "path": "website/partners/api/v2/views.py"}]}