prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  SubmissionSchema needs more nested fields
  I'm having trouble accessing a user's name from a SubmissionSchema dump. This is probably because we need more Nested Fields on the Schema in addition to just the nested challenge schema. 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `CTFd/schemas/submissions.py`
  Content:
  ```
  1 from marshmallow import fields
  2 
  3 from CTFd.models import Submissions, ma
  4 from CTFd.schemas.challenges import ChallengeSchema
  5 from CTFd.utils import string_types
  6 
  7 
  8 class SubmissionSchema(ma.ModelSchema):
  9     challenge = fields.Nested(ChallengeSchema, only=["name", "category", "value"])
  10 
  11     class Meta:
  12         model = Submissions
  13         include_fk = True
  14         dump_only = ("id",)
  15 
  16     views = {
  17         "admin": [
  18             "provided",
  19             "ip",
  20             "challenge_id",
  21             "challenge",
  22             "user",
  23             "team",
  24             "date",
  25             "type",
  26             "id",
  27         ],
  28         "user": ["challenge_id", "challenge", "user", "team", "date", "type", "id"],
  29     }
  30 
  31     def __init__(self, view=None, *args, **kwargs):
  32         if view:
  33             if isinstance(view, string_types):
  34                 kwargs["only"] = self.views[view]
  35             elif isinstance(view, list):
  36                 kwargs["only"] = view
  37 
  38         super(SubmissionSchema, self).__init__(*args, **kwargs)
  39
  ```
  --- 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/CTFd/schemas/submissions.py b/CTFd/schemas/submissions.py
  --- a/CTFd/schemas/submissions.py
  +++ b/CTFd/schemas/submissions.py
  @@ -2,11 +2,15 @@
   
   from CTFd.models import Submissions, ma
   from CTFd.schemas.challenges import ChallengeSchema
  +from CTFd.schemas.teams import TeamSchema
  +from CTFd.schemas.users import UserSchema
   from CTFd.utils import string_types
   
   
   class SubmissionSchema(ma.ModelSchema):
  -    challenge = fields.Nested(ChallengeSchema, only=["name", "category", "value"])
  +    challenge = fields.Nested(ChallengeSchema, only=["id", "name", "category", "value"])
  +    user = fields.Nested(UserSchema, only=["id", "name"])
  +    team = fields.Nested(TeamSchema, only=["id", "name"])
   
       class Meta:
           model = Submissions
  
verification_info: {"golden_diff": "diff --git a/CTFd/schemas/submissions.py b/CTFd/schemas/submissions.py\n--- a/CTFd/schemas/submissions.py\n+++ b/CTFd/schemas/submissions.py\n@@ -2,11 +2,15 @@\n \n from CTFd.models import Submissions, ma\n from CTFd.schemas.challenges import ChallengeSchema\n+from CTFd.schemas.teams import TeamSchema\n+from CTFd.schemas.users import UserSchema\n from CTFd.utils import string_types\n \n \n class SubmissionSchema(ma.ModelSchema):\n-    challenge = fields.Nested(ChallengeSchema, only=[\"name\", \"category\", \"value\"])\n+    challenge = fields.Nested(ChallengeSchema, only=[\"id\", \"name\", \"category\", \"value\"])\n+    user = fields.Nested(UserSchema, only=[\"id\", \"name\"])\n+    team = fields.Nested(TeamSchema, only=[\"id\", \"name\"])\n \n     class Meta:\n         model = Submissions\n", "issue": "SubmissionSchema needs more nested fields\nI'm having trouble accessing a user's name from a SubmissionSchema dump. This is probably because we need more Nested Fields on the Schema in addition to just the nested challenge schema. \n", "before_files": [{"content": "from marshmallow import fields\n\nfrom CTFd.models import Submissions, ma\nfrom CTFd.schemas.challenges import ChallengeSchema\nfrom CTFd.utils import string_types\n\n\nclass SubmissionSchema(ma.ModelSchema):\n    challenge = fields.Nested(ChallengeSchema, only=[\"name\", \"category\", \"value\"])\n\n    class Meta:\n        model = Submissions\n        include_fk = True\n        dump_only = (\"id\",)\n\n    views = {\n        \"admin\": [\n            \"provided\",\n            \"ip\",\n            \"challenge_id\",\n            \"challenge\",\n            \"user\",\n            \"team\",\n            \"date\",\n            \"type\",\n            \"id\",\n        ],\n        \"user\": [\"challenge_id\", \"challenge\", \"user\", \"team\", \"date\", \"type\", \"id\"],\n    }\n\n    def __init__(self, view=None, *args, **kwargs):\n        if view:\n            if isinstance(view, string_types):\n                kwargs[\"only\"] = self.views[view]\n            elif isinstance(view, list):\n                kwargs[\"only\"] = view\n\n        super(SubmissionSchema, self).__init__(*args, **kwargs)\n", "path": "CTFd/schemas/submissions.py"}], "after_files": [{"content": "from marshmallow import fields\n\nfrom CTFd.models import Submissions, ma\nfrom CTFd.schemas.challenges import ChallengeSchema\nfrom CTFd.schemas.teams import TeamSchema\nfrom CTFd.schemas.users import UserSchema\nfrom CTFd.utils import string_types\n\n\nclass SubmissionSchema(ma.ModelSchema):\n    challenge = fields.Nested(ChallengeSchema, only=[\"id\", \"name\", \"category\", \"value\"])\n    user = fields.Nested(UserSchema, only=[\"id\", \"name\"])\n    team = fields.Nested(TeamSchema, only=[\"id\", \"name\"])\n\n    class Meta:\n        model = Submissions\n        include_fk = True\n        dump_only = (\"id\",)\n\n    views = {\n        \"admin\": [\n            \"provided\",\n            \"ip\",\n            \"challenge_id\",\n            \"challenge\",\n            \"user\",\n            \"team\",\n            \"date\",\n            \"type\",\n            \"id\",\n        ],\n        \"user\": [\"challenge_id\", \"challenge\", \"user\", \"team\", \"date\", \"type\", \"id\"],\n    }\n\n    def __init__(self, view=None, *args, **kwargs):\n        if view:\n            if isinstance(view, string_types):\n                kwargs[\"only\"] = self.views[view]\n            elif isinstance(view, list):\n                kwargs[\"only\"] = view\n\n        super(SubmissionSchema, self).__init__(*args, **kwargs)\n", "path": "CTFd/schemas/submissions.py"}]}