mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(python): use standard dict/list type annotation
Since Python 3.9 list/dict can be used as type hint.
This commit is contained in:
parent
28970ccc91
commit
a509e40474
31 changed files with 175 additions and 195 deletions
|
@ -1,4 +1,4 @@
|
|||
from typing import Any, Dict
|
||||
from typing import Any
|
||||
|
||||
from fastapi import Request
|
||||
|
||||
|
@ -34,7 +34,7 @@ def simple(U: str = str(), E: str = str(), H: bool = False,
|
|||
def language(L: str = str(),
|
||||
request: Request = None,
|
||||
user: models.User = None,
|
||||
context: Dict[str, Any] = {},
|
||||
context: dict[str, Any] = {},
|
||||
**kwargs) -> None:
|
||||
if L and L != user.LangPreference:
|
||||
with db.begin():
|
||||
|
@ -45,7 +45,7 @@ def language(L: str = str(),
|
|||
def timezone(TZ: str = str(),
|
||||
request: Request = None,
|
||||
user: models.User = None,
|
||||
context: Dict[str, Any] = {},
|
||||
context: dict[str, Any] = {},
|
||||
**kwargs) -> None:
|
||||
if TZ and TZ != user.Timezone:
|
||||
with db.begin():
|
||||
|
@ -95,7 +95,7 @@ def account_type(T: int = None,
|
|||
def password(P: str = str(),
|
||||
request: Request = None,
|
||||
user: models.User = None,
|
||||
context: Dict[str, Any] = {},
|
||||
context: dict[str, Any] = {},
|
||||
**kwargs) -> None:
|
||||
if P and not user.valid_password(P):
|
||||
# Remove the fields we consumed for passwords.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue