Skip to content

Commit 91d6401

Browse files
authored
Handle poster rooms: change Main Hall A|B|C to Exhibit Hall (#40)
1 parent 29b5a0a commit 91d6401

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/misc.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ class Room(Enum):
4646
north_hall = "North Hall"
4747
south_hall_2a = "South Hall 2A"
4848
south_hall_2b = "South Hall 2B"
49-
main_hall_a = "Main Hall A"
50-
main_hall_b = "Main Hall B"
51-
main_hall_c = "Main Hall C"
49+
exhibit_hall = "Exhibit Hall"
5250

5351

5452
class EventType(Enum):

src/models/europython.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from datetime import date, datetime
44

5-
from pydantic import BaseModel, Field, computed_field, model_validator
5+
from pydantic import BaseModel, Field, computed_field, field_validator, model_validator
66

77
from src.config import Config
88
from src.misc import EventType, Room, SpeakerQuestion, SubmissionQuestion
@@ -143,6 +143,13 @@ class EuroPythonSession(BaseModel):
143143
prev_session: str | None = None
144144
slot_count: int = Field(..., exclude=True)
145145

146+
@field_validator("room", mode="before")
147+
@classmethod
148+
def handle_poster_room(cls, value) -> str | None:
149+
if value and "Main Hall" in value:
150+
return "Exhibit Hall"
151+
return value
152+
146153
@computed_field
147154
def website_url(self) -> str:
148155
return (

0 commit comments

Comments
 (0)