prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add album to event foreign key to api
  Feature request (I'm making this via the Github app so the template doesn't work) 
  
  
  See title, Julian wants this :)
  
  </issue>
  <code>
  [start of website/photos/api/v2/serializers/album.py]
  1 from rest_framework import serializers
  2 
  3 from photos import services
  4 from photos.api.v2.serializers.photo import PhotoSerializer, PhotoListSerializer
  5 from photos.models import Album
  6 from thaliawebsite.api.v2.serializers.cleaned_model_serializer import (
  7     CleanedModelSerializer,
  8 )
  9 
  10 
  11 class AlbumSerializer(CleanedModelSerializer):
  12     """API serializer for albums."""
  13 
  14     class Meta:
  15         """Meta class for the serializer."""
  16 
  17         model = Album
  18         fields = ("slug", "title", "accessible", "shareable", "cover", "photos")
  19 
  20     cover = PhotoSerializer()
  21     accessible = serializers.SerializerMethodField("_accessible")
  22     photos = PhotoListSerializer(source="photo_set", many=True)
  23 
  24     def _accessible(self, obj):
  25         return services.is_album_accessible(self.context["request"], obj)
  26 
  27 
  28 class AlbumListSerializer(AlbumSerializer):
  29     class Meta:
  30         """Meta class for the serializer."""
  31 
  32         model = Album
  33         fields = ("slug", "title", "accessible", "shareable", "cover")
  34
  [end of website/photos/api/v2/serializers/album.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/photos/api/v2/serializers/album.py b/website/photos/api/v2/serializers/album.py
  --- a/website/photos/api/v2/serializers/album.py
  +++ b/website/photos/api/v2/serializers/album.py
  @@ -15,7 +15,15 @@
           """Meta class for the serializer."""
   
           model = Album
  -        fields = ("slug", "title", "accessible", "shareable", "cover", "photos")
  +        fields = (
  +            "slug",
  +            "title",
  +            "accessible",
  +            "shareable",
  +            "cover",
  +            "photos",
  +            "event",
  +        )
   
       cover = PhotoSerializer()
       accessible = serializers.SerializerMethodField("_accessible")
  @@ -30,4 +38,4 @@
           """Meta class for the serializer."""
   
           model = Album
  -        fields = ("slug", "title", "accessible", "shareable", "cover")
  +        fields = ("slug", "title", "accessible", "shareable", "cover", "event")
  
verification_info: {"golden_diff": "diff --git a/website/photos/api/v2/serializers/album.py b/website/photos/api/v2/serializers/album.py\n--- a/website/photos/api/v2/serializers/album.py\n+++ b/website/photos/api/v2/serializers/album.py\n@@ -15,7 +15,15 @@\n         \"\"\"Meta class for the serializer.\"\"\"\n \n         model = Album\n-        fields = (\"slug\", \"title\", \"accessible\", \"shareable\", \"cover\", \"photos\")\n+        fields = (\n+            \"slug\",\n+            \"title\",\n+            \"accessible\",\n+            \"shareable\",\n+            \"cover\",\n+            \"photos\",\n+            \"event\",\n+        )\n \n     cover = PhotoSerializer()\n     accessible = serializers.SerializerMethodField(\"_accessible\")\n@@ -30,4 +38,4 @@\n         \"\"\"Meta class for the serializer.\"\"\"\n \n         model = Album\n-        fields = (\"slug\", \"title\", \"accessible\", \"shareable\", \"cover\")\n+        fields = (\"slug\", \"title\", \"accessible\", \"shareable\", \"cover\", \"event\")\n", "issue": "Add album to event foreign key to api\nFeature request (I'm making this via the Github app so the template doesn't work) \n\n\nSee title, Julian wants this :)\n", "before_files": [{"content": "from rest_framework import serializers\n\nfrom photos import services\nfrom photos.api.v2.serializers.photo import PhotoSerializer, PhotoListSerializer\nfrom photos.models import Album\nfrom thaliawebsite.api.v2.serializers.cleaned_model_serializer import (\n    CleanedModelSerializer,\n)\n\n\nclass AlbumSerializer(CleanedModelSerializer):\n    \"\"\"API serializer for albums.\"\"\"\n\n    class Meta:\n        \"\"\"Meta class for the serializer.\"\"\"\n\n        model = Album\n        fields = (\"slug\", \"title\", \"accessible\", \"shareable\", \"cover\", \"photos\")\n\n    cover = PhotoSerializer()\n    accessible = serializers.SerializerMethodField(\"_accessible\")\n    photos = PhotoListSerializer(source=\"photo_set\", many=True)\n\n    def _accessible(self, obj):\n        return services.is_album_accessible(self.context[\"request\"], obj)\n\n\nclass AlbumListSerializer(AlbumSerializer):\n    class Meta:\n        \"\"\"Meta class for the serializer.\"\"\"\n\n        model = Album\n        fields = (\"slug\", \"title\", \"accessible\", \"shareable\", \"cover\")\n", "path": "website/photos/api/v2/serializers/album.py"}]}