Skip to content

Commit 2eb8b2c

Browse files
committed
Deserialization: Don't expect embedded submission.speakers
1 parent a3e667f commit 2eb8b2c

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

data/examples/pretalx/submissions.json

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,8 @@
22
{
33
"code": "A8CD3F",
44
"speakers": [
5-
{
6-
"code": "F3DC8A",
7-
"name": "A Speaker",
8-
"biography": "This is a biography of F3D speaker",
9-
"avatar": "https://pretalx.com/media/avatars/picture.jpg",
10-
"email": "[email protected]"
11-
},
12-
{
13-
"code": "ZXCVBN",
14-
"name": "ZXC Speaker",
15-
"biography": "This is a biography of ZXC speaker",
16-
"avatar": "https://pretalx.com/media/avatars/picture.jpg",
17-
"email": "[email protected]"
18-
}
5+
"F3DC8A",
6+
"ZXCVBN"
197
],
208
"title": "This is a test talk from a test speaker about a test topic.",
219
"submission_type": "Talk (long session)",
@@ -127,13 +115,7 @@
127115
{
128116
"code": "B8CD4F",
129117
"speakers": [
130-
{
131-
"code": "G3DC8A",
132-
"name": "Another Speaker",
133-
"biography": "This is a biography of F3D speaker",
134-
"avatar": "https://pretalx.com/media/avatars/picture.jpg",
135-
"email": "[email protected]"
136-
}
118+
"G3DC8A"
137119
],
138120
"title": "A talk with shorter title",
139121
"submission_type": "Talk",

src/models/pretalx.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ def handle_resources(cls, v) -> list[dict[str, str]] | None:
9595
@model_validator(mode="before")
9696
@classmethod
9797
def process_values(cls, values) -> dict:
98-
values["speakers"] = sorted([s["code"] for s in values["speakers"]])
99-
10098
# Set slot information
10199
if values.get("slots"):
102100
slot = PretalxSlot.model_validate(values["slots"][0])

0 commit comments

Comments
 (0)