prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Incorrect Fields in Jobs serializer
  *Observed code:* [here](https://github.com/Cloud-CV/EvalAI/blob/master/apps/jobs/serializers.py/#L54)
  ```
  class Meta:
          model = LeaderboardData
          fields = "__all__"
          fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')
  ```
  *Expected Code:*
  ```
  class Meta:
          model = LeaderboardData
          fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')
  ```
  
  --- 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/jobs/serializers.py`
  Content:
  ```
  1 from django.contrib.auth.models import User
  2 
  3 from rest_framework import serializers
  4 
  5 from challenges.models import LeaderboardData
  6 from participants.models import Participant, ParticipantTeam
  7 
  8 from .models import Submission
  9 
  10 
  11 class SubmissionSerializer(serializers.ModelSerializer):
  12 
  13     participant_team_name = serializers.SerializerMethodField()
  14     execution_time = serializers.SerializerMethodField()
  15 
  16     def __init__(self, *args, **kwargs):
  17         context = kwargs.get('context')
  18         if context and context.get('request').method == 'POST':
  19             created_by = context.get('request').user
  20             kwargs['data']['created_by'] = created_by.pk
  21 
  22             participant_team = context.get('participant_team').pk
  23             kwargs['data']['participant_team'] = participant_team
  24 
  25             challenge_phase = context.get('challenge_phase').pk
  26             kwargs['data']['challenge_phase'] = challenge_phase
  27 
  28         super(SubmissionSerializer, self).__init__(*args, **kwargs)
  29 
  30     class Meta:
  31         model = Submission
  32         fields = ('id', 'participant_team', 'participant_team_name', 'execution_time', 'challenge_phase',
  33                   'created_by', 'status', 'input_file', 'stdout_file', 'stderr_file', 'submitted_at',
  34                   'method_name', 'method_description', 'project_url', 'publication_url', 'is_public',
  35                   'submission_result_file', 'when_made_public',)
  36 
  37     def get_participant_team_name(self, obj):
  38         return obj.participant_team.team_name
  39 
  40     def get_execution_time(self, obj):
  41         return obj.execution_time
  42 
  43 
  44 class LeaderboardDataSerializer(serializers.ModelSerializer):
  45 
  46     participant_team_name = serializers.SerializerMethodField()
  47     leaderboard_schema = serializers.SerializerMethodField()
  48 
  49     def __init__(self, *args, **kwargs):
  50         super(LeaderboardDataSerializer, self).__init__(*args, **kwargs)
  51 
  52     class Meta:
  53         model = LeaderboardData
  54         fields = "__all__"
  55         fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')
  56 
  57     def get_participant_team_name(self, obj):
  58         return obj.submission.participant_team.team_name
  59 
  60     def get_leaderboard_schema(self, obj):
  61         return obj.leaderboard.schema
  62 
  63 
  64 class ChallengeSubmissionManagementSerializer(serializers.ModelSerializer):
  65 
  66     participant_team = serializers.SerializerMethodField()
  67     challenge_phase = serializers.SerializerMethodField()
  68     created_by = serializers.SerializerMethodField()
  69     participant_team_members_email_ids = serializers.SerializerMethodField()
  70     created_at = serializers.SerializerMethodField()
  71     participant_team_members = serializers.SerializerMethodField()
  72 
  73     class Meta:
  74         model = Submission
  75         fields = ('id', 'participant_team', 'challenge_phase', 'created_by', 'status', 'is_public',
  76                   'submission_number', 'submitted_at', 'execution_time', 'input_file', 'stdout_file',
  77                   'stderr_file', 'submission_result_file', 'submission_metadata_file',
  78                   'participant_team_members_email_ids', 'created_at', 'method_name', 'participant_team_members',)
  79 
  80     def get_participant_team(self, obj):
  81         return obj.participant_team.team_name
  82 
  83     def get_challenge_phase(self, obj):
  84         return obj.challenge_phase.name
  85 
  86     def get_created_by(self, obj):
  87         return obj.created_by.username
  88 
  89     def get_participant_team_members_email_ids(self, obj):
  90         try:
  91             participant_team = ParticipantTeam.objects.get(team_name=obj.participant_team.team_name)
  92         except ParticipantTeam.DoesNotExist:
  93             return 'Participant team does not exist'
  94 
  95         participant_ids = Participant.objects.filter(team=participant_team).values_list('user_id', flat=True)
  96         return list(User.objects.filter(id__in=participant_ids).values_list('email', flat=True))
  97 
  98     def get_created_at(self, obj):
  99         return obj.created_at
  100 
  101     def get_participant_team_members(self, obj):
  102         try:
  103             participant_team = ParticipantTeam.objects.get(team_name=obj.participant_team.team_name)
  104         except ParticipantTeam.DoesNotExist:
  105             return 'Participant team does not exist'
  106 
  107         participant_ids = Participant.objects.filter(team=participant_team).values_list('user_id', flat=True)
  108         return list(User.objects.filter(id__in=participant_ids).values('username', 'email'))
  109 
  110 
  111 class SubmissionCount(object):
  112     def __init__(self, submission_count):
  113         self.submission_count = submission_count
  114 
  115 
  116 class SubmissionCountSerializer(serializers.Serializer):
  117     submission_count = serializers.IntegerField()
  118 
  119 
  120 class LastSubmissionDateTime(object):
  121     def __init__(self, last_submission_datetime):
  122         self.last_submission_datetime = last_submission_datetime
  123 
  124 
  125 class LastSubmissionDateTimeSerializer(serializers.Serializer):
  126     last_submission_datetime = serializers.DateTimeField()
  127 
  128 
  129 class CreateLeaderboardDataSerializer(serializers.ModelSerializer):
  130 
  131     def __init__(self, *args, **kwargs):
  132         context = kwargs.get('context')
  133         if context and context.get('request').method == 'PUT':
  134             challenge_phase_split = context.get('challenge_phase_split')
  135             kwargs['data']['challenge_phase_split'] = challenge_phase_split.pk
  136 
  137             submission = context.get('submission').pk
  138             kwargs['data']['submission'] = submission
  139 
  140             kwargs['data']['leaderboard'] = challenge_phase_split.leaderboard.pk
  141 
  142         super(CreateLeaderboardDataSerializer, self).__init__(*args, **kwargs)
  143 
  144     class Meta:
  145         model = LeaderboardData
  146         fields = ('challenge_phase_split', 'submission', 'result', 'leaderboard')
  147
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/apps/jobs/serializers.py b/apps/jobs/serializers.py
  --- a/apps/jobs/serializers.py
  +++ b/apps/jobs/serializers.py
  @@ -51,7 +51,6 @@
   
       class Meta:
           model = LeaderboardData
  -        fields = "__all__"
           fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')
   
       def get_participant_team_name(self, obj):
  
verification_info: {"golden_diff": "diff --git a/apps/jobs/serializers.py b/apps/jobs/serializers.py\n--- a/apps/jobs/serializers.py\n+++ b/apps/jobs/serializers.py\n@@ -51,7 +51,6 @@\n \n     class Meta:\n         model = LeaderboardData\n-        fields = \"__all__\"\n         fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')\n \n     def get_participant_team_name(self, obj):\n", "issue": "Incorrect Fields in Jobs serializer\n*Observed code:* [here](https://github.com/Cloud-CV/EvalAI/blob/master/apps/jobs/serializers.py/#L54)\r\n```\r\nclass Meta:\r\n        model = LeaderboardData\r\n        fields = \"__all__\"\r\n        fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')\r\n```\r\n*Expected Code:*\r\n```\r\nclass Meta:\r\n        model = LeaderboardData\r\n        fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')\r\n```\n", "before_files": [{"content": "from django.contrib.auth.models import User\n\nfrom rest_framework import serializers\n\nfrom challenges.models import LeaderboardData\nfrom participants.models import Participant, ParticipantTeam\n\nfrom .models import Submission\n\n\nclass SubmissionSerializer(serializers.ModelSerializer):\n\n    participant_team_name = serializers.SerializerMethodField()\n    execution_time = serializers.SerializerMethodField()\n\n    def __init__(self, *args, **kwargs):\n        context = kwargs.get('context')\n        if context and context.get('request').method == 'POST':\n            created_by = context.get('request').user\n            kwargs['data']['created_by'] = created_by.pk\n\n            participant_team = context.get('participant_team').pk\n            kwargs['data']['participant_team'] = participant_team\n\n            challenge_phase = context.get('challenge_phase').pk\n            kwargs['data']['challenge_phase'] = challenge_phase\n\n        super(SubmissionSerializer, self).__init__(*args, **kwargs)\n\n    class Meta:\n        model = Submission\n        fields = ('id', 'participant_team', 'participant_team_name', 'execution_time', 'challenge_phase',\n                  'created_by', 'status', 'input_file', 'stdout_file', 'stderr_file', 'submitted_at',\n                  'method_name', 'method_description', 'project_url', 'publication_url', 'is_public',\n                  'submission_result_file', 'when_made_public',)\n\n    def get_participant_team_name(self, obj):\n        return obj.participant_team.team_name\n\n    def get_execution_time(self, obj):\n        return obj.execution_time\n\n\nclass LeaderboardDataSerializer(serializers.ModelSerializer):\n\n    participant_team_name = serializers.SerializerMethodField()\n    leaderboard_schema = serializers.SerializerMethodField()\n\n    def __init__(self, *args, **kwargs):\n        super(LeaderboardDataSerializer, self).__init__(*args, **kwargs)\n\n    class Meta:\n        model = LeaderboardData\n        fields = \"__all__\"\n        fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')\n\n    def get_participant_team_name(self, obj):\n        return obj.submission.participant_team.team_name\n\n    def get_leaderboard_schema(self, obj):\n        return obj.leaderboard.schema\n\n\nclass ChallengeSubmissionManagementSerializer(serializers.ModelSerializer):\n\n    participant_team = serializers.SerializerMethodField()\n    challenge_phase = serializers.SerializerMethodField()\n    created_by = serializers.SerializerMethodField()\n    participant_team_members_email_ids = serializers.SerializerMethodField()\n    created_at = serializers.SerializerMethodField()\n    participant_team_members = serializers.SerializerMethodField()\n\n    class Meta:\n        model = Submission\n        fields = ('id', 'participant_team', 'challenge_phase', 'created_by', 'status', 'is_public',\n                  'submission_number', 'submitted_at', 'execution_time', 'input_file', 'stdout_file',\n                  'stderr_file', 'submission_result_file', 'submission_metadata_file',\n                  'participant_team_members_email_ids', 'created_at', 'method_name', 'participant_team_members',)\n\n    def get_participant_team(self, obj):\n        return obj.participant_team.team_name\n\n    def get_challenge_phase(self, obj):\n        return obj.challenge_phase.name\n\n    def get_created_by(self, obj):\n        return obj.created_by.username\n\n    def get_participant_team_members_email_ids(self, obj):\n        try:\n            participant_team = ParticipantTeam.objects.get(team_name=obj.participant_team.team_name)\n        except ParticipantTeam.DoesNotExist:\n            return 'Participant team does not exist'\n\n        participant_ids = Participant.objects.filter(team=participant_team).values_list('user_id', flat=True)\n        return list(User.objects.filter(id__in=participant_ids).values_list('email', flat=True))\n\n    def get_created_at(self, obj):\n        return obj.created_at\n\n    def get_participant_team_members(self, obj):\n        try:\n            participant_team = ParticipantTeam.objects.get(team_name=obj.participant_team.team_name)\n        except ParticipantTeam.DoesNotExist:\n            return 'Participant team does not exist'\n\n        participant_ids = Participant.objects.filter(team=participant_team).values_list('user_id', flat=True)\n        return list(User.objects.filter(id__in=participant_ids).values('username', 'email'))\n\n\nclass SubmissionCount(object):\n    def __init__(self, submission_count):\n        self.submission_count = submission_count\n\n\nclass SubmissionCountSerializer(serializers.Serializer):\n    submission_count = serializers.IntegerField()\n\n\nclass LastSubmissionDateTime(object):\n    def __init__(self, last_submission_datetime):\n        self.last_submission_datetime = last_submission_datetime\n\n\nclass LastSubmissionDateTimeSerializer(serializers.Serializer):\n    last_submission_datetime = serializers.DateTimeField()\n\n\nclass CreateLeaderboardDataSerializer(serializers.ModelSerializer):\n\n    def __init__(self, *args, **kwargs):\n        context = kwargs.get('context')\n        if context and context.get('request').method == 'PUT':\n            challenge_phase_split = context.get('challenge_phase_split')\n            kwargs['data']['challenge_phase_split'] = challenge_phase_split.pk\n\n            submission = context.get('submission').pk\n            kwargs['data']['submission'] = submission\n\n            kwargs['data']['leaderboard'] = challenge_phase_split.leaderboard.pk\n\n        super(CreateLeaderboardDataSerializer, self).__init__(*args, **kwargs)\n\n    class Meta:\n        model = LeaderboardData\n        fields = ('challenge_phase_split', 'submission', 'result', 'leaderboard')\n", "path": "apps/jobs/serializers.py"}], "after_files": [{"content": "from django.contrib.auth.models import User\n\nfrom rest_framework import serializers\n\nfrom challenges.models import LeaderboardData\nfrom participants.models import Participant, ParticipantTeam\n\nfrom .models import Submission\n\n\nclass SubmissionSerializer(serializers.ModelSerializer):\n\n    participant_team_name = serializers.SerializerMethodField()\n    execution_time = serializers.SerializerMethodField()\n\n    def __init__(self, *args, **kwargs):\n        context = kwargs.get('context')\n        if context and context.get('request').method == 'POST':\n            created_by = context.get('request').user\n            kwargs['data']['created_by'] = created_by.pk\n\n            participant_team = context.get('participant_team').pk\n            kwargs['data']['participant_team'] = participant_team\n\n            challenge_phase = context.get('challenge_phase').pk\n            kwargs['data']['challenge_phase'] = challenge_phase\n\n        super(SubmissionSerializer, self).__init__(*args, **kwargs)\n\n    class Meta:\n        model = Submission\n        fields = ('id', 'participant_team', 'participant_team_name', 'execution_time', 'challenge_phase',\n                  'created_by', 'status', 'input_file', 'stdout_file', 'stderr_file', 'submitted_at',\n                  'method_name', 'method_description', 'project_url', 'publication_url', 'is_public',\n                  'submission_result_file', 'when_made_public',)\n\n    def get_participant_team_name(self, obj):\n        return obj.participant_team.team_name\n\n    def get_execution_time(self, obj):\n        return obj.execution_time\n\n\nclass LeaderboardDataSerializer(serializers.ModelSerializer):\n\n    participant_team_name = serializers.SerializerMethodField()\n    leaderboard_schema = serializers.SerializerMethodField()\n\n    def __init__(self, *args, **kwargs):\n        super(LeaderboardDataSerializer, self).__init__(*args, **kwargs)\n\n    class Meta:\n        model = LeaderboardData\n        fields = ('id', 'participant_team_name', 'challenge_phase_split', 'leaderboard_schema', 'result')\n\n    def get_participant_team_name(self, obj):\n        return obj.submission.participant_team.team_name\n\n    def get_leaderboard_schema(self, obj):\n        return obj.leaderboard.schema\n\n\nclass ChallengeSubmissionManagementSerializer(serializers.ModelSerializer):\n\n    participant_team = serializers.SerializerMethodField()\n    challenge_phase = serializers.SerializerMethodField()\n    created_by = serializers.SerializerMethodField()\n    participant_team_members_email_ids = serializers.SerializerMethodField()\n    created_at = serializers.SerializerMethodField()\n    participant_team_members = serializers.SerializerMethodField()\n\n    class Meta:\n        model = Submission\n        fields = ('id', 'participant_team', 'challenge_phase', 'created_by', 'status', 'is_public',\n                  'submission_number', 'submitted_at', 'execution_time', 'input_file', 'stdout_file',\n                  'stderr_file', 'submission_result_file', 'submission_metadata_file',\n                  'participant_team_members_email_ids', 'created_at', 'method_name', 'participant_team_members',)\n\n    def get_participant_team(self, obj):\n        return obj.participant_team.team_name\n\n    def get_challenge_phase(self, obj):\n        return obj.challenge_phase.name\n\n    def get_created_by(self, obj):\n        return obj.created_by.username\n\n    def get_participant_team_members_email_ids(self, obj):\n        try:\n            participant_team = ParticipantTeam.objects.get(team_name=obj.participant_team.team_name)\n        except ParticipantTeam.DoesNotExist:\n            return 'Participant team does not exist'\n\n        participant_ids = Participant.objects.filter(team=participant_team).values_list('user_id', flat=True)\n        return list(User.objects.filter(id__in=participant_ids).values_list('email', flat=True))\n\n    def get_created_at(self, obj):\n        return obj.created_at\n\n    def get_participant_team_members(self, obj):\n        try:\n            participant_team = ParticipantTeam.objects.get(team_name=obj.participant_team.team_name)\n        except ParticipantTeam.DoesNotExist:\n            return 'Participant team does not exist'\n\n        participant_ids = Participant.objects.filter(team=participant_team).values_list('user_id', flat=True)\n        return list(User.objects.filter(id__in=participant_ids).values('username', 'email'))\n\n\nclass SubmissionCount(object):\n    def __init__(self, submission_count):\n        self.submission_count = submission_count\n\n\nclass SubmissionCountSerializer(serializers.Serializer):\n    submission_count = serializers.IntegerField()\n\n\nclass LastSubmissionDateTime(object):\n    def __init__(self, last_submission_datetime):\n        self.last_submission_datetime = last_submission_datetime\n\n\nclass LastSubmissionDateTimeSerializer(serializers.Serializer):\n    last_submission_datetime = serializers.DateTimeField()\n\n\nclass CreateLeaderboardDataSerializer(serializers.ModelSerializer):\n\n    def __init__(self, *args, **kwargs):\n        context = kwargs.get('context')\n        if context and context.get('request').method == 'PUT':\n            challenge_phase_split = context.get('challenge_phase_split')\n            kwargs['data']['challenge_phase_split'] = challenge_phase_split.pk\n\n            submission = context.get('submission').pk\n            kwargs['data']['submission'] = submission\n\n            kwargs['data']['leaderboard'] = challenge_phase_split.leaderboard.pk\n\n        super(CreateLeaderboardDataSerializer, self).__init__(*args, **kwargs)\n\n    class Meta:\n        model = LeaderboardData\n        fields = ('challenge_phase_split', 'submission', 'result', 'leaderboard')\n", "path": "apps/jobs/serializers.py"}]}