Use basedpyright refactor

This commit is contained in:
marc
2025-03-22 23:06:34 +01:00
parent ac54453b7f
commit 2f7c7c2429
41 changed files with 480 additions and 381 deletions

View File

@@ -1,4 +1,4 @@
from typing import Annotated, Optional
from typing import Annotated
from fastapi import Cookie, Form, Request
from folkugat_web.api import router
@@ -8,13 +8,13 @@ from folkugat_web.services import auth as service
@router.get("/api/nota")
def nota_input(request: Request, value: Optional[str] = None):
def nota_input(request: Request, value: str | None = None):
return nota.input(request, value)
@router.post("/api/nota")
def login(request: Request, value: Annotated[Optional[str], Form()] = None,
nota_folkugat: Annotated[Optional[str], Cookie()] = None):
def login(request: Request, value: Annotated[str | None, Form()] = None,
nota_folkugat: Annotated[str | None, Cookie()] = None):
logged_in = service.logged_in(nota_folkugat)
new_login = service.login(value)
if new_login and not logged_in: