Skip to content

Commit

Permalink
style: fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 19, 2024
1 parent 0112b11 commit 756d654
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@ ban-relative-imports = "all"
#length-sort = true
lines-after-imports = 2
known-first-party = ["lint", "bgm"]

[tool.mypy]
warn_no_return = false
check_untyped_defs = true
2 changes: 1 addition & 1 deletion server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

class File(NamedTuple):
content: bytes
content_type: str
content_type: str | None


static_path = PROJECT_PATH.joinpath("server/static/")
Expand Down
2 changes: 1 addition & 1 deletion server/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def clear(self, predicate: ClearCookiePredicate | None = None) -> None:
def clear_domain(self, domain: str) -> None:
return

def update_cookies(self, cookies: LooseCookies, response_url: URL = None) -> None:
def update_cookies(self, cookies: LooseCookies, response_url: URL | None = None) -> None:
return

def filter_cookies(self, request_url: URL) -> BaseCookie[str]:
Expand Down
6 changes: 3 additions & 3 deletions server/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from datetime import datetime
from typing import Annotated, Any

import asyncpg
import litestar
import orjson
from asyncpg.pool import PoolConnectionProxy
from litestar import Response
from litestar.enums import RequestEncodingType
from litestar.exceptions import InternalServerException, NotAuthorizedException, NotFoundException
Expand Down Expand Up @@ -61,7 +61,7 @@ async def review_patch(
raise NotAuthorizedException("暂不支持")


async def __reject_patch(patch: Patch, conn: asyncpg.Connection, auth: User) -> Redirect:
async def __reject_patch(patch: Patch, conn: PoolConnectionProxy, auth: User) -> Redirect:
await conn.execute(
"""
update patch set
Expand All @@ -78,7 +78,7 @@ async def __reject_patch(patch: Patch, conn: asyncpg.Connection, auth: User) ->
return Redirect("/")


async def __accept_patch(patch: Patch, conn: asyncpg.Connection, auth: User) -> Response:
async def __accept_patch(patch: Patch, conn: PoolConnectionProxy, auth: User) -> Response:
if not auth.is_access_token_fresh():
return Redirect("/login")

Expand Down

0 comments on commit 756d654

Please sign in to comment.