We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Searching in photos api is broken
### Describe the bug
Searching in photos api is broken

### How to reproduce
Steps to reproduce the behaviour:
1. Go to https://thalia.nu/api/v1/photos/albums/?search=Test

### Expected behaviour
This should not crash.



--- 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/photos/api/viewsets.py`
Content:
```
1 from rest_framework import permissions, filters
2 from rest_framework.exceptions import PermissionDenied
3 from rest_framework.mixins import CreateModelMixin, UpdateModelMixin
4 from rest_framework.viewsets import ModelViewSet, GenericViewSet
5 
6 from photos import services
7 from photos.api import serializers
8 from photos.models import Album, Photo
9 
10 
11 class AlbumsViewSet(ModelViewSet):
12     """ViewSet class for an Album object."""
13 
14     permission_classes = (permissions.IsAuthenticated,)
15     queryset = Album.objects.all()
16     filter_backends = (filters.SearchFilter,)
17     search_fields = ("title_en", "title_nl", "date", "slug")
18 
19     def get_queryset(self):
20         """Return albums that are annotated to be accessible by the request user."""
21         return services.get_annotated_accessible_albums(
22             self.request, Album.objects.all()
23         )
24 
25     def create(self, request, *args, **kwargs):
26         """Create album if the request user is allowed to."""
27         if self.request.user.has_perm("photos.create_album"):
28             return super().create(request, *args, **kwargs)
29         raise PermissionDenied
30 
31     def update(self, request, *args, **kwargs):
32         """Create album if the request user is allowed to."""
33         if self.request.user.has_perm("photos.change_album"):
34             return super().update(request, *args, **kwargs)
35         raise PermissionDenied
36 
37     def get_serializer_class(self):
38         """Return AlbumListSerializer if the current action is list else return AlbumSerializer."""
39         if self.action == "list":
40             return serializers.AlbumListSerializer
41         return serializers.AlbumSerializer
42 
43 
44 class PhotosViewSet(GenericViewSet, CreateModelMixin, UpdateModelMixin):
45     """ViewSet class for a Photo object."""
46 
47     queryset = Photo.objects.all()
48     permission_classes = (permissions.IsAuthenticated,)
49     serializer_class = serializers.PhotoCreateSerializer
50 
51     def create(self, request, *args, **kwargs):
52         """Create photo if the request user is allowed to."""
53         if self.request.user.has_perm("photos.create_photo"):
54             return super().create(request, *args, **kwargs)
55         raise PermissionDenied
56 
57     def update(self, request, *args, **kwargs):
58         """Update photo if the request user is allowed to."""
59         if self.request.user.has_perm("photos.change_photo"):
60             return super().update(request, *args, **kwargs)
61         raise PermissionDenied
62
```
--- 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()

```

diff --git a/website/photos/api/viewsets.py b/website/photos/api/viewsets.py
--- a/website/photos/api/viewsets.py
+++ b/website/photos/api/viewsets.py
@@ -14,7 +14,7 @@
     permission_classes = (permissions.IsAuthenticated,)
     queryset = Album.objects.all()
     filter_backends = (filters.SearchFilter,)
-    search_fields = ("title_en", "title_nl", "date", "slug")
+    search_fields = ("title_en", "date", "slug")
 
     def get_queryset(self):
         """Return albums that are annotated to be accessible by the request user."""

{"golden_diff": "diff --git a/website/photos/api/viewsets.py b/website/photos/api/viewsets.py\n--- a/website/photos/api/viewsets.py\n+++ b/website/photos/api/viewsets.py\n@@ -14,7 +14,7 @@\n     permission_classes = (permissions.IsAuthenticated,)\n     queryset = Album.objects.all()\n     filter_backends = (filters.SearchFilter,)\n-    search_fields = (\"title_en\", \"title_nl\", \"date\", \"slug\")\n+    search_fields = (\"title_en\", \"date\", \"slug\")\n \n     def get_queryset(self):\n         \"\"\"Return albums that are annotated to be accessible by the request user.\"\"\"\n", "issue": "Searching in photos api is broken\n### Describe the bug\r\nSearching in photos api is broken\r\n\r\n### How to reproduce\r\nSteps to reproduce the behaviour:\r\n1. Go to https://thalia.nu/api/v1/photos/albums/?search=Test\r\n\r\n### Expected behaviour\r\nThis should not crash.\r\n\r\n\n", "before_files": [{"content": "from rest_framework import permissions, filters\nfrom rest_framework.exceptions import PermissionDenied\nfrom rest_framework.mixins import CreateModelMixin, UpdateModelMixin\nfrom rest_framework.viewsets import ModelViewSet, GenericViewSet\n\nfrom photos import services\nfrom photos.api import serializers\nfrom photos.models import Album, Photo\n\n\nclass AlbumsViewSet(ModelViewSet):\n    \"\"\"ViewSet class for an Album object.\"\"\"\n\n    permission_classes = (permissions.IsAuthenticated,)\n    queryset = Album.objects.all()\n    filter_backends = (filters.SearchFilter,)\n    search_fields = (\"title_en\", \"title_nl\", \"date\", \"slug\")\n\n    def get_queryset(self):\n        \"\"\"Return albums that are annotated to be accessible by the request user.\"\"\"\n        return services.get_annotated_accessible_albums(\n            self.request, Album.objects.all()\n        )\n\n    def create(self, request, *args, **kwargs):\n        \"\"\"Create album if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.create_album\"):\n            return super().create(request, *args, **kwargs)\n        raise PermissionDenied\n\n    def update(self, request, *args, **kwargs):\n        \"\"\"Create album if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.change_album\"):\n            return super().update(request, *args, **kwargs)\n        raise PermissionDenied\n\n    def get_serializer_class(self):\n        \"\"\"Return AlbumListSerializer if the current action is list else return AlbumSerializer.\"\"\"\n        if self.action == \"list\":\n            return serializers.AlbumListSerializer\n        return serializers.AlbumSerializer\n\n\nclass PhotosViewSet(GenericViewSet, CreateModelMixin, UpdateModelMixin):\n    \"\"\"ViewSet class for a Photo object.\"\"\"\n\n    queryset = Photo.objects.all()\n    permission_classes = (permissions.IsAuthenticated,)\n    serializer_class = serializers.PhotoCreateSerializer\n\n    def create(self, request, *args, **kwargs):\n        \"\"\"Create photo if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.create_photo\"):\n            return super().create(request, *args, **kwargs)\n        raise PermissionDenied\n\n    def update(self, request, *args, **kwargs):\n        \"\"\"Update photo if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.change_photo\"):\n            return super().update(request, *args, **kwargs)\n        raise PermissionDenied\n", "path": "website/photos/api/viewsets.py"}], "after_files": [{"content": "from rest_framework import permissions, filters\nfrom rest_framework.exceptions import PermissionDenied\nfrom rest_framework.mixins import CreateModelMixin, UpdateModelMixin\nfrom rest_framework.viewsets import ModelViewSet, GenericViewSet\n\nfrom photos import services\nfrom photos.api import serializers\nfrom photos.models import Album, Photo\n\n\nclass AlbumsViewSet(ModelViewSet):\n    \"\"\"ViewSet class for an Album object.\"\"\"\n\n    permission_classes = (permissions.IsAuthenticated,)\n    queryset = Album.objects.all()\n    filter_backends = (filters.SearchFilter,)\n    search_fields = (\"title_en\", \"date\", \"slug\")\n\n    def get_queryset(self):\n        \"\"\"Return albums that are annotated to be accessible by the request user.\"\"\"\n        return services.get_annotated_accessible_albums(\n            self.request, Album.objects.all()\n        )\n\n    def create(self, request, *args, **kwargs):\n        \"\"\"Create album if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.create_album\"):\n            return super().create(request, *args, **kwargs)\n        raise PermissionDenied\n\n    def update(self, request, *args, **kwargs):\n        \"\"\"Create album if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.change_album\"):\n            return super().update(request, *args, **kwargs)\n        raise PermissionDenied\n\n    def get_serializer_class(self):\n        \"\"\"Return AlbumListSerializer if the current action is list else return AlbumSerializer.\"\"\"\n        if self.action == \"list\":\n            return serializers.AlbumListSerializer\n        return serializers.AlbumSerializer\n\n\nclass PhotosViewSet(GenericViewSet, CreateModelMixin, UpdateModelMixin):\n    \"\"\"ViewSet class for a Photo object.\"\"\"\n\n    queryset = Photo.objects.all()\n    permission_classes = (permissions.IsAuthenticated,)\n    serializer_class = serializers.PhotoCreateSerializer\n\n    def create(self, request, *args, **kwargs):\n        \"\"\"Create photo if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.create_photo\"):\n            return super().create(request, *args, **kwargs)\n        raise PermissionDenied\n\n    def update(self, request, *args, **kwargs):\n        \"\"\"Update photo if the request user is allowed to.\"\"\"\n        if self.request.user.has_perm(\"photos.change_photo\"):\n            return super().update(request, *args, **kwargs)\n        raise PermissionDenied\n", "path": "website/photos/api/viewsets.py"}]}