prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  
  </issue>
  <code>
  [start of website/partners/api/v2/views.py]
  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 of website/partners/api/v2/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/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"}]}