Skip to content

Commit

Permalink
Mypy refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
depocoder committed Sep 27, 2024
1 parent ddec6fc commit 7333010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/yet_another_calendar/web/api/modeus/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from .schema import (
ModeusEventsBody, ModeusCalendar,
FullEvent, FullModeusPersonSearch, SearchPeople, ExtendedPerson
FullEvent, FullModeusPersonSearch, SearchPeople, ExtendedPerson,
)

_token_re = re.compile(r"id_token=([a-zA-Z0-9\-_.]+)")
Expand Down Expand Up @@ -64,7 +64,7 @@ async def get_auth_form(session: AsyncClient, username: str, password: str) -> T

form = html.form
if form is None:
raise HTTPException(detail=f"Can't get form.", status_code=response.status_code)
raise HTTPException(detail="Can't get form.", status_code=response.status_code)
return form


Expand Down Expand Up @@ -104,7 +104,7 @@ async def login(username: str, __password: str, timeout: int = 15) -> str:
token = _extract_token_from_url(response.url.fragment)
if token is None:
raise HTTPException(
detail=f"Can't get token. Response: {response.text}", status_code=response.status_code
detail=f"Can't get token. Response: {response.text}", status_code=response.status_code,
)
return token

Expand Down
2 changes: 1 addition & 1 deletion backend/yet_another_calendar/web/api/modeus/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ async def search_blank(
"""
Search people from Modeus when no account.
"""
return await integration.get_people(jwt_token, schema.FullModeusPersonSearch(**{"fullName": full_name}))
return await integration.get_people(jwt_token, schema.FullModeusPersonSearch.model_validate({"fullName": full_name}))

0 comments on commit 7333010

Please sign in to comment.