prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Event registration member serializer should be read only
  ### Describe the bug
  https://github.com/svthalia/concrexit/blob/4ab37961f50e398cc52422cdc1df66f6ab8ff2ee/website/events/api/v2/serializers/event_registration.py#L34 This serializer should be read-only
  
  ### How to reproduce
  https://staging.thalia.nu/api/v2/events/150/registrations/ shows that you can POST to update the member profile, that should not be the case
  
  ### Expected behaviour
  Be read only
  
  
  </issue>
  <code>
  [start of website/events/api/v2/serializers/event_registration.py]
  1 from rest_framework import serializers
  2 
  3 from events.models import EventRegistration
  4 from members.api.v2.serializers.member import MemberSerializer
  5 
  6 
  7 class EventRegistrationSerializer(serializers.ModelSerializer):
  8     """Serializer for event registrations."""
  9 
  10     def __init__(self, *args, **kwargs):
  11         # Don't pass the 'fields' arg up to the superclass
  12         fields = kwargs.pop("fields", {"pk", "member", "name"})
  13 
  14         # Instantiate the superclass normally
  15         super().__init__(*args, **kwargs)
  16 
  17         allowed = set(fields)
  18         existing = set(self.fields.keys())
  19         for field_name in existing - allowed:
  20             self.fields.pop(field_name)
  21 
  22     class Meta:
  23         model = EventRegistration
  24         fields = (
  25             "pk",
  26             "present",
  27             "queue_position",
  28             "date",
  29             "payment",
  30             "member",
  31             "name",
  32         )
  33 
  34     member = MemberSerializer(detailed=False)
  35
  [end of website/events/api/v2/serializers/event_registration.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/events/api/v2/serializers/event_registration.py b/website/events/api/v2/serializers/event_registration.py
  --- a/website/events/api/v2/serializers/event_registration.py
  +++ b/website/events/api/v2/serializers/event_registration.py
  @@ -31,4 +31,4 @@
               "name",
           )
   
  -    member = MemberSerializer(detailed=False)
  +    member = MemberSerializer(detailed=False, read_only=True)
  
verification_info: {"golden_diff": "diff --git a/website/events/api/v2/serializers/event_registration.py b/website/events/api/v2/serializers/event_registration.py\n--- a/website/events/api/v2/serializers/event_registration.py\n+++ b/website/events/api/v2/serializers/event_registration.py\n@@ -31,4 +31,4 @@\n             \"name\",\n         )\n \n-    member = MemberSerializer(detailed=False)\n+    member = MemberSerializer(detailed=False, read_only=True)\n", "issue": "Event registration member serializer should be read only\n### Describe the bug\r\nhttps://github.com/svthalia/concrexit/blob/4ab37961f50e398cc52422cdc1df66f6ab8ff2ee/website/events/api/v2/serializers/event_registration.py#L34 This serializer should be read-only\r\n\r\n### How to reproduce\r\nhttps://staging.thalia.nu/api/v2/events/150/registrations/ shows that you can POST to update the member profile, that should not be the case\r\n\r\n### Expected behaviour\r\nBe read only\r\n\n", "before_files": [{"content": "from rest_framework import serializers\n\nfrom events.models import EventRegistration\nfrom members.api.v2.serializers.member import MemberSerializer\n\n\nclass EventRegistrationSerializer(serializers.ModelSerializer):\n    \"\"\"Serializer for event registrations.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        # Don't pass the 'fields' arg up to the superclass\n        fields = kwargs.pop(\"fields\", {\"pk\", \"member\", \"name\"})\n\n        # Instantiate the superclass normally\n        super().__init__(*args, **kwargs)\n\n        allowed = set(fields)\n        existing = set(self.fields.keys())\n        for field_name in existing - allowed:\n            self.fields.pop(field_name)\n\n    class Meta:\n        model = EventRegistration\n        fields = (\n            \"pk\",\n            \"present\",\n            \"queue_position\",\n            \"date\",\n            \"payment\",\n            \"member\",\n            \"name\",\n        )\n\n    member = MemberSerializer(detailed=False)\n", "path": "website/events/api/v2/serializers/event_registration.py"}]}