We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Schedule Editor does not clear extra fields on existing items
When replacing an existing item in the schedule editor, the notes, css_class and details fields are not replaced or cleared.

While this can be useful to leave css_class untouched, it is surprising behaviour and usually the wrong thing to do for notes  and details. 

I think we must clear notes and details when this happens.

We should probably clear all extra fields when replacing an item, for the sake of predictablity,


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `wafer/schedule/serializers.py`
Content:
```
1 from rest_framework import serializers
2 
3 from wafer.talks.models import Talk
4 from wafer.pages.models import Page
5 from wafer.schedule.models import ScheduleItem, Venue, Slot
6 
7 
8 class ScheduleItemSerializer(serializers.HyperlinkedModelSerializer):
9     page = serializers.PrimaryKeyRelatedField(
10         allow_null=True, queryset=Page.objects.all())
11     talk = serializers.PrimaryKeyRelatedField(
12         allow_null=True, queryset=Talk.objects.all())
13     venue = serializers.PrimaryKeyRelatedField(
14         allow_null=True, queryset=Venue.objects.all())
15     slots = serializers.PrimaryKeyRelatedField(
16         allow_null=True, many=True, queryset=Slot.objects.all())
17 
18     class Meta:
19         model = ScheduleItem
20         fields = ('id', 'talk', 'page', 'venue', 'slots')
21 
22     def create(self, validated_data):
23         venue_id = validated_data['venue']
24         slots = validated_data['slots']
25         talk = validated_data.get('talk')
26         page = validated_data.get('page')
27 
28         try:
29             existing_schedule_item = ScheduleItem.objects.get(
30                 venue_id=venue_id, slots__in=slots)
31         except ScheduleItem.DoesNotExist:
32             pass
33         else:
34             existing_schedule_item.talk = talk
35             existing_schedule_item.page = page
36             existing_schedule_item.slots = slots
37             existing_schedule_item.save()
38             return existing_schedule_item
39         return super(ScheduleItemSerializer, self).create(validated_data)
40 
41 
42
```
--- 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/wafer/schedule/serializers.py b/wafer/schedule/serializers.py
--- a/wafer/schedule/serializers.py
+++ b/wafer/schedule/serializers.py
@@ -34,6 +34,12 @@
             existing_schedule_item.talk = talk
             existing_schedule_item.page = page
             existing_schedule_item.slots = slots
+            # Clear any existing details that aren't editable by the
+            # schedule edit view
+            existing_schedule_item.details = ''
+            existing_schedule_item.notes = ''
+            existing_schedule_item.css_class = ''
+            existing_schedule_item.expand = False
             existing_schedule_item.save()
             return existing_schedule_item
         return super(ScheduleItemSerializer, self).create(validated_data)

{"golden_diff": "diff --git a/wafer/schedule/serializers.py b/wafer/schedule/serializers.py\n--- a/wafer/schedule/serializers.py\n+++ b/wafer/schedule/serializers.py\n@@ -34,6 +34,12 @@\n             existing_schedule_item.talk = talk\n             existing_schedule_item.page = page\n             existing_schedule_item.slots = slots\n+            # Clear any existing details that aren't editable by the\n+            # schedule edit view\n+            existing_schedule_item.details = ''\n+            existing_schedule_item.notes = ''\n+            existing_schedule_item.css_class = ''\n+            existing_schedule_item.expand = False\n             existing_schedule_item.save()\n             return existing_schedule_item\n         return super(ScheduleItemSerializer, self).create(validated_data)\n", "issue": "Schedule Editor does not clear extra fields on existing items\nWhen replacing an existing item in the schedule editor, the notes, css_class and details fields are not replaced or cleared.\n\nWhile this can be useful to leave css_class untouched, it is surprising behaviour and usually the wrong thing to do for notes  and details. \n\nI think we must clear notes and details when this happens.\n\nWe should probably clear all extra fields when replacing an item, for the sake of predictablity,\n\n", "before_files": [{"content": "from rest_framework import serializers\n\nfrom wafer.talks.models import Talk\nfrom wafer.pages.models import Page\nfrom wafer.schedule.models import ScheduleItem, Venue, Slot\n\n\nclass ScheduleItemSerializer(serializers.HyperlinkedModelSerializer):\n    page = serializers.PrimaryKeyRelatedField(\n        allow_null=True, queryset=Page.objects.all())\n    talk = serializers.PrimaryKeyRelatedField(\n        allow_null=True, queryset=Talk.objects.all())\n    venue = serializers.PrimaryKeyRelatedField(\n        allow_null=True, queryset=Venue.objects.all())\n    slots = serializers.PrimaryKeyRelatedField(\n        allow_null=True, many=True, queryset=Slot.objects.all())\n\n    class Meta:\n        model = ScheduleItem\n        fields = ('id', 'talk', 'page', 'venue', 'slots')\n\n    def create(self, validated_data):\n        venue_id = validated_data['venue']\n        slots = validated_data['slots']\n        talk = validated_data.get('talk')\n        page = validated_data.get('page')\n\n        try:\n            existing_schedule_item = ScheduleItem.objects.get(\n                venue_id=venue_id, slots__in=slots)\n        except ScheduleItem.DoesNotExist:\n            pass\n        else:\n            existing_schedule_item.talk = talk\n            existing_schedule_item.page = page\n            existing_schedule_item.slots = slots\n            existing_schedule_item.save()\n            return existing_schedule_item\n        return super(ScheduleItemSerializer, self).create(validated_data)\n\n\n", "path": "wafer/schedule/serializers.py"}], "after_files": [{"content": "from rest_framework import serializers\n\nfrom wafer.talks.models import Talk\nfrom wafer.pages.models import Page\nfrom wafer.schedule.models import ScheduleItem, Venue, Slot\n\n\nclass ScheduleItemSerializer(serializers.HyperlinkedModelSerializer):\n    page = serializers.PrimaryKeyRelatedField(\n        allow_null=True, queryset=Page.objects.all())\n    talk = serializers.PrimaryKeyRelatedField(\n        allow_null=True, queryset=Talk.objects.all())\n    venue = serializers.PrimaryKeyRelatedField(\n        allow_null=True, queryset=Venue.objects.all())\n    slots = serializers.PrimaryKeyRelatedField(\n        allow_null=True, many=True, queryset=Slot.objects.all())\n\n    class Meta:\n        model = ScheduleItem\n        fields = ('id', 'talk', 'page', 'venue', 'slots')\n\n    def create(self, validated_data):\n        venue_id = validated_data['venue']\n        slots = validated_data['slots']\n        talk = validated_data.get('talk')\n        page = validated_data.get('page')\n\n        try:\n            existing_schedule_item = ScheduleItem.objects.get(\n                venue_id=venue_id, slots__in=slots)\n        except ScheduleItem.DoesNotExist:\n            pass\n        else:\n            existing_schedule_item.talk = talk\n            existing_schedule_item.page = page\n            existing_schedule_item.slots = slots\n            # Clear any existing details that aren't editable by the\n            # schedule edit view\n            existing_schedule_item.details = ''\n            existing_schedule_item.notes = ''\n            existing_schedule_item.css_class = ''\n            existing_schedule_item.expand = False\n            existing_schedule_item.save()\n            return existing_schedule_item\n        return super(ScheduleItemSerializer, self).create(validated_data)\n\n\n", "path": "wafer/schedule/serializers.py"}]}