We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Event (registration) status message in the API
### Is your feature request related to a problem? Please describe.
Currently, the event status messages (like 'you cannot cancel your registration without having to pay a fine') are hardcoded and whenever we update them, we must also update the app

### Describe the solution you'd like
Put the message in the API

### Additional context
Also checkout #1381 

--- 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/events/api/v2/serializers/event.py`
Content:
```
1 from rest_framework import serializers
2 
3 from activemembers.api.v2.serializers.member_group import MemberGroupSerializer
4 from announcements.api.v2.serializers import SlideSerializer
5 from documents.api.v2.serializers.document import DocumentSerializer
6 from events import services
7 from events.api.v2.serializers.event_registration import EventRegistrationSerializer
8 from events.models import Event, EventRegistration
9 from thaliawebsite.api.v2.serializers import CleanedHTMLSerializer
10 from utils.snippets import create_google_maps_url
11 
12 
13 class EventSerializer(serializers.ModelSerializer):
14     """Serializer for events."""
15 
16     class Meta:
17         model = Event
18         fields = (
19             "pk",
20             "title",
21             "description",
22             "start",
23             "end",
24             "category",
25             "registration_start",
26             "registration_end",
27             "cancel_deadline",
28             "optional_registrations",
29             "location",
30             "price",
31             "fine",
32             "num_participants",
33             "max_participants",
34             "no_registration_message",
35             "has_fields",
36             "food_event",
37             "maps_url",
38             "user_permissions",
39             "user_registration",
40             "organiser",
41             "slide",
42             "documents",
43         )
44 
45     description = CleanedHTMLSerializer()
46     organiser = MemberGroupSerializer()
47     user_registration = serializers.SerializerMethodField("_user_registration")
48     num_participants = serializers.SerializerMethodField("_num_participants")
49     maps_url = serializers.SerializerMethodField("_maps_url")
50     price = serializers.DecimalField(max_digits=5, decimal_places=2)
51     fine = serializers.DecimalField(max_digits=5, decimal_places=2)
52     slide = SlideSerializer()
53     documents = DocumentSerializer(many=True)
54     user_permissions = serializers.SerializerMethodField("_user_permissions")
55 
56     def _user_registration(self, instance):
57         try:
58             if self.context["request"].member:
59                 reg = instance.eventregistration_set.get(
60                     member=self.context["request"].member, date_cancelled=None
61                 )
62                 return EventRegistrationSerializer(
63                     reg,
64                     context=self.context,
65                     fields=("pk", "present", "queue_position", "date", "payment"),
66                 ).data
67         except EventRegistration.DoesNotExist:
68             pass
69         return None
70 
71     def _num_participants(self, instance):
72         if (
73             instance.max_participants
74             and instance.participants.count() > instance.max_participants
75         ):
76             return instance.max_participants
77         return instance.participants.count()
78 
79     def _user_permissions(self, instance):
80         member = self.context["request"].member
81         return services.event_permissions(member, instance)
82 
83     def _maps_url(self, instance):
84         return create_google_maps_url(instance.map_location, zoom=13, size="450x250")
85
```
--- 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/events/api/v2/serializers/event.py b/website/events/api/v2/serializers/event.py
--- a/website/events/api/v2/serializers/event.py
+++ b/website/events/api/v2/serializers/event.py
@@ -32,6 +32,7 @@
             "num_participants",
             "max_participants",
             "no_registration_message",
+            "cancel_too_late_message",
             "has_fields",
             "food_event",
             "maps_url",

{"golden_diff": "diff --git a/website/events/api/v2/serializers/event.py b/website/events/api/v2/serializers/event.py\n--- a/website/events/api/v2/serializers/event.py\n+++ b/website/events/api/v2/serializers/event.py\n@@ -32,6 +32,7 @@\n             \"num_participants\",\n             \"max_participants\",\n             \"no_registration_message\",\n+            \"cancel_too_late_message\",\n             \"has_fields\",\n             \"food_event\",\n             \"maps_url\",\n", "issue": "Event (registration) status message in the API\n### Is your feature request related to a problem? Please describe.\r\nCurrently, the event status messages (like 'you cannot cancel your registration without having to pay a fine') are hardcoded and whenever we update them, we must also update the app\r\n\r\n### Describe the solution you'd like\r\nPut the message in the API\r\n\r\n### Additional context\r\nAlso checkout #1381 \n", "before_files": [{"content": "from rest_framework import serializers\n\nfrom activemembers.api.v2.serializers.member_group import MemberGroupSerializer\nfrom announcements.api.v2.serializers import SlideSerializer\nfrom documents.api.v2.serializers.document import DocumentSerializer\nfrom events import services\nfrom events.api.v2.serializers.event_registration import EventRegistrationSerializer\nfrom events.models import Event, EventRegistration\nfrom thaliawebsite.api.v2.serializers import CleanedHTMLSerializer\nfrom utils.snippets import create_google_maps_url\n\n\nclass EventSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for events.\"\"\"\n\n    class Meta:\n        model = Event\n        fields = (\n            \"pk\",\n            \"title\",\n            \"description\",\n            \"start\",\n            \"end\",\n            \"category\",\n            \"registration_start\",\n            \"registration_end\",\n            \"cancel_deadline\",\n            \"optional_registrations\",\n            \"location\",\n            \"price\",\n            \"fine\",\n            \"num_participants\",\n            \"max_participants\",\n            \"no_registration_message\",\n            \"has_fields\",\n            \"food_event\",\n            \"maps_url\",\n            \"user_permissions\",\n            \"user_registration\",\n            \"organiser\",\n            \"slide\",\n            \"documents\",\n        )\n\n    description = CleanedHTMLSerializer()\n    organiser = MemberGroupSerializer()\n    user_registration = serializers.SerializerMethodField(\"_user_registration\")\n    num_participants = serializers.SerializerMethodField(\"_num_participants\")\n    maps_url = serializers.SerializerMethodField(\"_maps_url\")\n    price = serializers.DecimalField(max_digits=5, decimal_places=2)\n    fine = serializers.DecimalField(max_digits=5, decimal_places=2)\n    slide = SlideSerializer()\n    documents = DocumentSerializer(many=True)\n    user_permissions = serializers.SerializerMethodField(\"_user_permissions\")\n\n    def _user_registration(self, instance):\n        try:\n            if self.context[\"request\"].member:\n                reg = instance.eventregistration_set.get(\n                    member=self.context[\"request\"].member, date_cancelled=None\n                )\n                return EventRegistrationSerializer(\n                    reg,\n                    context=self.context,\n                    fields=(\"pk\", \"present\", \"queue_position\", \"date\", \"payment\"),\n                ).data\n        except EventRegistration.DoesNotExist:\n            pass\n        return None\n\n    def _num_participants(self, instance):\n        if (\n            instance.max_participants\n            and instance.participants.count() > instance.max_participants\n        ):\n            return instance.max_participants\n        return instance.participants.count()\n\n    def _user_permissions(self, instance):\n        member = self.context[\"request\"].member\n        return services.event_permissions(member, instance)\n\n    def _maps_url(self, instance):\n        return create_google_maps_url(instance.map_location, zoom=13, size=\"450x250\")\n", "path": "website/events/api/v2/serializers/event.py"}], "after_files": [{"content": "from rest_framework import serializers\n\nfrom activemembers.api.v2.serializers.member_group import MemberGroupSerializer\nfrom announcements.api.v2.serializers import SlideSerializer\nfrom documents.api.v2.serializers.document import DocumentSerializer\nfrom events import services\nfrom events.api.v2.serializers.event_registration import EventRegistrationSerializer\nfrom events.models import Event, EventRegistration\nfrom thaliawebsite.api.v2.serializers import CleanedHTMLSerializer\nfrom utils.snippets import create_google_maps_url\n\n\nclass EventSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for events.\"\"\"\n\n    class Meta:\n        model = Event\n        fields = (\n            \"pk\",\n            \"title\",\n            \"description\",\n            \"start\",\n            \"end\",\n            \"category\",\n            \"registration_start\",\n            \"registration_end\",\n            \"cancel_deadline\",\n            \"optional_registrations\",\n            \"location\",\n            \"price\",\n            \"fine\",\n            \"num_participants\",\n            \"max_participants\",\n            \"no_registration_message\",\n            \"cancel_too_late_message\",\n            \"has_fields\",\n            \"food_event\",\n            \"maps_url\",\n            \"user_permissions\",\n            \"user_registration\",\n            \"organiser\",\n            \"slide\",\n            \"documents\",\n        )\n\n    description = CleanedHTMLSerializer()\n    organiser = MemberGroupSerializer()\n    user_registration = serializers.SerializerMethodField(\"_user_registration\")\n    num_participants = serializers.SerializerMethodField(\"_num_participants\")\n    maps_url = serializers.SerializerMethodField(\"_maps_url\")\n    price = serializers.DecimalField(max_digits=5, decimal_places=2)\n    fine = serializers.DecimalField(max_digits=5, decimal_places=2)\n    slide = SlideSerializer()\n    documents = DocumentSerializer(many=True)\n    user_permissions = serializers.SerializerMethodField(\"_user_permissions\")\n\n    def _user_registration(self, instance):\n        try:\n            if self.context[\"request\"].member:\n                reg = instance.eventregistration_set.get(\n                    member=self.context[\"request\"].member, date_cancelled=None\n                )\n                return EventRegistrationSerializer(\n                    reg,\n                    context=self.context,\n                    fields=(\"pk\", \"present\", \"queue_position\", \"date\", \"payment\"),\n                ).data\n        except EventRegistration.DoesNotExist:\n            pass\n        return None\n\n    def _num_participants(self, instance):\n        if (\n            instance.max_participants\n            and instance.participants.count() > instance.max_participants\n        ):\n            return instance.max_participants\n        return instance.participants.count()\n\n    def _user_permissions(self, instance):\n        member = self.context[\"request\"].member\n        return services.event_permissions(member, instance)\n\n    def _maps_url(self, instance):\n        return create_google_maps_url(instance.map_location, zoom=13, size=\"450x250\")\n", "path": "website/events/api/v2/serializers/event.py"}]}