Skip to content

Commit d97dac1

Browse files
committed
Fix slot
* Download: Expand slots.room * Transform: Parse first slot # Conflicts: # src/download.py
1 parent e82524e commit d97dac1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/models/pretalx.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PretalxSlot(BaseModel):
3333
@classmethod
3434
def handle_localized(cls, v) -> str | None:
3535
if isinstance(v, dict):
36-
return v.get("en")
36+
return v["name"].get("en")
3737
return v
3838

3939

@@ -96,8 +96,9 @@ def handle_resources(cls, v) -> list[dict[str, str]] | None:
9696
@classmethod
9797
def process_values(cls, values) -> dict:
9898
# Set slot information
99-
if values.get("slot"):
100-
slot = PretalxSlot.model_validate(values["slot"])
99+
if values.get("slots"):
100+
slot = PretalxSlot.model_validate(values["slots"][0])
101+
values["slot"] = slot
101102
values["room"] = slot.room
102103
values["start"] = slot.start
103104
values["end"] = slot.end

0 commit comments

Comments
 (0)