We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add serializers for creating challenge using zip file.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `apps/challenges/serializers.py`
Content:
```
1 from rest_framework import serializers
2 
3 from hosts.serializers import ChallengeHostTeamSerializer
4 
5 from .models import (
6                      Challenge,
7                      ChallengePhase,
8                      ChallengePhaseSplit,
9                      DatasetSplit,)
10 
11 
12 class ChallengeSerializer(serializers.ModelSerializer):
13 
14     is_active = serializers.ReadOnlyField()
15 
16     def __init__(self, *args, **kwargs):
17         super(ChallengeSerializer, self).__init__(*args, **kwargs)
18         context = kwargs.get('context')
19         if context and context.get('request').method != 'GET':
20             challenge_host_team = context.get('challenge_host_team')
21             kwargs['data']['creator'] = challenge_host_team.pk
22         else:
23             self.fields['creator'] = ChallengeHostTeamSerializer()
24 
25     class Meta:
26         model = Challenge
27         fields = ('id', 'title', 'short_description', 'description', 'terms_and_conditions',
28                   'submission_guidelines', 'evaluation_details',
29                   'image', 'start_date', 'end_date', 'creator',
30                   'published', 'enable_forum', 'anonymous_leaderboard', 'is_active',)
31 
32 
33 class ChallengePhaseSerializer(serializers.ModelSerializer):
34 
35     is_active = serializers.ReadOnlyField()
36 
37     def __init__(self, *args, **kwargs):
38         super(ChallengePhaseSerializer, self).__init__(*args, **kwargs)
39         context = kwargs.get('context')
40         if context:
41             challenge = context.get('challenge')
42             kwargs['data']['challenge'] = challenge.pk
43 
44     class Meta:
45         model = ChallengePhase
46         fields = ('id', 'name', 'description', 'leaderboard_public', 'start_date',
47                   'end_date', 'challenge', 'max_submissions_per_day', 'max_submissions',
48                   'is_public', 'is_active', 'codename')
49 
50 
51 class DatasetSplitSerializer(serializers.ModelSerializer):
52 
53     class Meta:
54         model = DatasetSplit
55         fields = '__all__'
56 
57 
58 class ChallengePhaseSplitSerializer(serializers.ModelSerializer):
59     """Serialize the ChallengePhaseSplits Model"""
60 
61     dataset_split_name = serializers.SerializerMethodField()
62     challenge_phase_name = serializers.SerializerMethodField()
63 
64     class Meta:
65         model = ChallengePhaseSplit
66         fields = '__all__'
67         fields = ('id', 'dataset_split', 'challenge_phase', 'challenge_phase_name', 'dataset_split_name', 'visibility')
68 
69     def get_dataset_split_name(self, obj):
70         return obj.dataset_split.name
71 
72     def get_challenge_phase_name(self, obj):
73         return obj.challenge_phase.name
74
```
--- 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/apps/challenges/serializers.py b/apps/challenges/serializers.py
--- a/apps/challenges/serializers.py
+++ b/apps/challenges/serializers.py
@@ -2,11 +2,12 @@
 
 from hosts.serializers import ChallengeHostTeamSerializer
 
-from .models import (
-                     Challenge,
+from .models import (Challenge,
+                     ChallengeConfiguration,
                      ChallengePhase,
                      ChallengePhaseSplit,
-                     DatasetSplit,)
+                     DatasetSplit,
+                     Leaderboard,)
 
 
 class ChallengeSerializer(serializers.ModelSerializer):
@@ -63,7 +64,6 @@
 
     class Meta:
         model = ChallengePhaseSplit
-        fields = '__all__'
         fields = ('id', 'dataset_split', 'challenge_phase', 'challenge_phase_name', 'dataset_split_name', 'visibility')
 
     def get_dataset_split_name(self, obj):
@@ -71,3 +71,48 @@
 
     def get_challenge_phase_name(self, obj):
         return obj.challenge_phase.name
+
+
+class ChallengeConfigSerializer(serializers.ModelSerializer):
+    """
+    Serialize the ChallengeConfiguration Model.
+    """
+    def __init__(self, *args, **kwargs):
+        super(ChallengeConfigSerializer, self).__init__(*args, **kwargs)
+        context = kwargs.get('context')
+        if context:
+            user = context.get('user')
+            kwargs['data']['user'] = user.pk
+
+    class Meta:
+        model = ChallengeConfiguration
+        fields = ('zip_configuration', 'user',)
+
+
+class LeaderboardSerializer(serializers.ModelSerializer):
+    """
+    Serialize the Leaderboard Model.
+    """
+    class Meta:
+        model = Leaderboard
+        fields = '__all__'
+
+
+class ZipChallengeSerializer(ChallengeSerializer):
+    """
+    Serializer used for creating challenge through zip file.
+    """
+    class Meta:
+        model = Challenge
+        fields = ('id', 'title', 'short_description', 'description', 'terms_and_conditions',
+                  'submission_guidelines', 'start_date', 'end_date', 'creator',
+                  'published', 'enable_forum', 'anonymous_leaderboard', 'is_active',)
+
+
+class ZipChallengePhaseSplitSerializer(serializers.ModelSerializer):
+    """
+    Serializer used for creating challenge phase split through zip file.
+    """
+    class Meta:
+        model = ChallengePhaseSplit
+        fields = '__all__'

{"golden_diff": "diff --git a/apps/challenges/serializers.py b/apps/challenges/serializers.py\n--- a/apps/challenges/serializers.py\n+++ b/apps/challenges/serializers.py\n@@ -2,11 +2,12 @@\n \n from hosts.serializers import ChallengeHostTeamSerializer\n \n-from .models import (\n-                     Challenge,\n+from .models import (Challenge,\n+                     ChallengeConfiguration,\n                      ChallengePhase,\n                      ChallengePhaseSplit,\n-                     DatasetSplit,)\n+                     DatasetSplit,\n+                     Leaderboard,)\n \n \n class ChallengeSerializer(serializers.ModelSerializer):\n@@ -63,7 +64,6 @@\n \n     class Meta:\n         model = ChallengePhaseSplit\n-        fields = '__all__'\n         fields = ('id', 'dataset_split', 'challenge_phase', 'challenge_phase_name', 'dataset_split_name', 'visibility')\n \n     def get_dataset_split_name(self, obj):\n@@ -71,3 +71,48 @@\n \n     def get_challenge_phase_name(self, obj):\n         return obj.challenge_phase.name\n+\n+\n+class ChallengeConfigSerializer(serializers.ModelSerializer):\n+    \"\"\"\n+    Serialize the ChallengeConfiguration Model.\n+    \"\"\"\n+    def __init__(self, *args, **kwargs):\n+        super(ChallengeConfigSerializer, self).__init__(*args, **kwargs)\n+        context = kwargs.get('context')\n+        if context:\n+            user = context.get('user')\n+            kwargs['data']['user'] = user.pk\n+\n+    class Meta:\n+        model = ChallengeConfiguration\n+        fields = ('zip_configuration', 'user',)\n+\n+\n+class LeaderboardSerializer(serializers.ModelSerializer):\n+    \"\"\"\n+    Serialize the Leaderboard Model.\n+    \"\"\"\n+    class Meta:\n+        model = Leaderboard\n+        fields = '__all__'\n+\n+\n+class ZipChallengeSerializer(ChallengeSerializer):\n+    \"\"\"\n+    Serializer used for creating challenge through zip file.\n+    \"\"\"\n+    class Meta:\n+        model = Challenge\n+        fields = ('id', 'title', 'short_description', 'description', 'terms_and_conditions',\n+                  'submission_guidelines', 'start_date', 'end_date', 'creator',\n+                  'published', 'enable_forum', 'anonymous_leaderboard', 'is_active',)\n+\n+\n+class ZipChallengePhaseSplitSerializer(serializers.ModelSerializer):\n+    \"\"\"\n+    Serializer used for creating challenge phase split through zip file.\n+    \"\"\"\n+    class Meta:\n+        model = ChallengePhaseSplit\n+        fields = '__all__'\n", "issue": "Add serializers for creating challenge using zip file.\n\n", "before_files": [{"content": "from rest_framework import serializers\n\nfrom hosts.serializers import ChallengeHostTeamSerializer\n\nfrom .models import (\n                     Challenge,\n                     ChallengePhase,\n                     ChallengePhaseSplit,\n                     DatasetSplit,)\n\n\nclass ChallengeSerializer(serializers.ModelSerializer):\n\n    is_active = serializers.ReadOnlyField()\n\n    def __init__(self, *args, **kwargs):\n        super(ChallengeSerializer, self).__init__(*args, **kwargs)\n        context = kwargs.get('context')\n        if context and context.get('request').method != 'GET':\n            challenge_host_team = context.get('challenge_host_team')\n            kwargs['data']['creator'] = challenge_host_team.pk\n        else:\n            self.fields['creator'] = ChallengeHostTeamSerializer()\n\n    class Meta:\n        model = Challenge\n        fields = ('id', 'title', 'short_description', 'description', 'terms_and_conditions',\n                  'submission_guidelines', 'evaluation_details',\n                  'image', 'start_date', 'end_date', 'creator',\n                  'published', 'enable_forum', 'anonymous_leaderboard', 'is_active',)\n\n\nclass ChallengePhaseSerializer(serializers.ModelSerializer):\n\n    is_active = serializers.ReadOnlyField()\n\n    def __init__(self, *args, **kwargs):\n        super(ChallengePhaseSerializer, self).__init__(*args, **kwargs)\n        context = kwargs.get('context')\n        if context:\n            challenge = context.get('challenge')\n            kwargs['data']['challenge'] = challenge.pk\n\n    class Meta:\n        model = ChallengePhase\n        fields = ('id', 'name', 'description', 'leaderboard_public', 'start_date',\n                  'end_date', 'challenge', 'max_submissions_per_day', 'max_submissions',\n                  'is_public', 'is_active', 'codename')\n\n\nclass DatasetSplitSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = DatasetSplit\n        fields = '__all__'\n\n\nclass ChallengePhaseSplitSerializer(serializers.ModelSerializer):\n    \"\"\"Serialize the ChallengePhaseSplits Model\"\"\"\n\n    dataset_split_name = serializers.SerializerMethodField()\n    challenge_phase_name = serializers.SerializerMethodField()\n\n    class Meta:\n        model = ChallengePhaseSplit\n        fields = '__all__'\n        fields = ('id', 'dataset_split', 'challenge_phase', 'challenge_phase_name', 'dataset_split_name', 'visibility')\n\n    def get_dataset_split_name(self, obj):\n        return obj.dataset_split.name\n\n    def get_challenge_phase_name(self, obj):\n        return obj.challenge_phase.name\n", "path": "apps/challenges/serializers.py"}], "after_files": [{"content": "from rest_framework import serializers\n\nfrom hosts.serializers import ChallengeHostTeamSerializer\n\nfrom .models import (Challenge,\n                     ChallengeConfiguration,\n                     ChallengePhase,\n                     ChallengePhaseSplit,\n                     DatasetSplit,\n                     Leaderboard,)\n\n\nclass ChallengeSerializer(serializers.ModelSerializer):\n\n    is_active = serializers.ReadOnlyField()\n\n    def __init__(self, *args, **kwargs):\n        super(ChallengeSerializer, self).__init__(*args, **kwargs)\n        context = kwargs.get('context')\n        if context and context.get('request').method != 'GET':\n            challenge_host_team = context.get('challenge_host_team')\n            kwargs['data']['creator'] = challenge_host_team.pk\n        else:\n            self.fields['creator'] = ChallengeHostTeamSerializer()\n\n    class Meta:\n        model = Challenge\n        fields = ('id', 'title', 'short_description', 'description', 'terms_and_conditions',\n                  'submission_guidelines', 'evaluation_details',\n                  'image', 'start_date', 'end_date', 'creator',\n                  'published', 'enable_forum', 'anonymous_leaderboard', 'is_active',)\n\n\nclass ChallengePhaseSerializer(serializers.ModelSerializer):\n\n    is_active = serializers.ReadOnlyField()\n\n    def __init__(self, *args, **kwargs):\n        super(ChallengePhaseSerializer, self).__init__(*args, **kwargs)\n        context = kwargs.get('context')\n        if context:\n            challenge = context.get('challenge')\n            kwargs['data']['challenge'] = challenge.pk\n\n    class Meta:\n        model = ChallengePhase\n        fields = ('id', 'name', 'description', 'leaderboard_public', 'start_date',\n                  'end_date', 'challenge', 'max_submissions_per_day', 'max_submissions',\n                  'is_public', 'is_active', 'codename')\n\n\nclass DatasetSplitSerializer(serializers.ModelSerializer):\n\n    class Meta:\n        model = DatasetSplit\n        fields = '__all__'\n\n\nclass ChallengePhaseSplitSerializer(serializers.ModelSerializer):\n    \"\"\"Serialize the ChallengePhaseSplits Model\"\"\"\n\n    dataset_split_name = serializers.SerializerMethodField()\n    challenge_phase_name = serializers.SerializerMethodField()\n\n    class Meta:\n        model = ChallengePhaseSplit\n        fields = ('id', 'dataset_split', 'challenge_phase', 'challenge_phase_name', 'dataset_split_name', 'visibility')\n\n    def get_dataset_split_name(self, obj):\n        return obj.dataset_split.name\n\n    def get_challenge_phase_name(self, obj):\n        return obj.challenge_phase.name\n\n\nclass ChallengeConfigSerializer(serializers.ModelSerializer):\n    \"\"\"\n    Serialize the ChallengeConfiguration Model.\n    \"\"\"\n    def __init__(self, *args, **kwargs):\n        super(ChallengeConfigSerializer, self).__init__(*args, **kwargs)\n        context = kwargs.get('context')\n        if context:\n            user = context.get('user')\n            kwargs['data']['user'] = user.pk\n\n    class Meta:\n        model = ChallengeConfiguration\n        fields = ('zip_configuration', 'user',)\n\n\nclass LeaderboardSerializer(serializers.ModelSerializer):\n    \"\"\"\n    Serialize the Leaderboard Model.\n    \"\"\"\n    class Meta:\n        model = Leaderboard\n        fields = '__all__'\n\n\nclass ZipChallengeSerializer(ChallengeSerializer):\n    \"\"\"\n    Serializer used for creating challenge through zip file.\n    \"\"\"\n    class Meta:\n        model = Challenge\n        fields = ('id', 'title', 'short_description', 'description', 'terms_and_conditions',\n                  'submission_guidelines', 'start_date', 'end_date', 'creator',\n                  'published', 'enable_forum', 'anonymous_leaderboard', 'is_active',)\n\n\nclass ZipChallengePhaseSplitSerializer(serializers.ModelSerializer):\n    \"\"\"\n    Serializer used for creating challenge phase split through zip file.\n    \"\"\"\n    class Meta:\n        model = ChallengePhaseSplit\n        fields = '__all__'\n", "path": "apps/challenges/serializers.py"}]}