Skip to content

Commit

Permalink
Fix bug with empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
depocoder committed Sep 26, 2024
1 parent 531be41 commit 03d921e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions backend/app/controllers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,21 @@ def serialize_modeus_response(self) -> list[FullEvent]:

class StudentsSpeciality(BaseModel):
id: uuid.UUID = Field(alias="personId")
flow_code: str = Field(alias="flowCode")
flow_code: Optional[str] = Field(alias="flowCode")
learning_start_date: Optional[datetime.datetime] = Field(alias="learningStartDate")
learning_end_date: Optional[datetime.datetime] = Field(alias="learningEndDate")
specialty_code: str = Field(alias="specialtyCode")
specialty_name: str = Field(alias="specialtyName")
specialty_profile: str = Field(alias="specialtyProfile")
specialty_code: Optional[str] = Field(alias="specialtyCode")
specialty_name: Optional[str] = Field(alias="specialtyName")
specialty_profile: Optional[str] = Field(alias="specialtyProfile")


class ExtendedPerson(StudentsSpeciality, ShortPerson):
pass


class PeopleEmbedded(BaseModel):
persons: list[ShortPerson]
students: list[StudentsSpeciality]
persons: list[ShortPerson] = Field(default=[])
students: list[StudentsSpeciality] = Field(default=[])


class SearchPeople(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion backend/integration/modeus.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _extract_token_from_url(url: str, match_index: int = 1) -> str | None:
return match[match_index]


async def post_modeus(__jwt: str, body: Any, url_part: str, timeout: int = 15):
async def post_modeus(__jwt: str, body: Any, url_part: str, timeout: int = 15) -> str:
session = AsyncClient(
http2=True,
base_url="https://utmn.modeus.org/",
Expand Down

0 comments on commit 03d921e

Please sign in to comment.