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,5 +1,3 @@
|
|||
from typing import List
|
||||
|
||||
from sqlalchemy import and_, literal
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import backref, relationship
|
||||
|
@ -60,7 +58,7 @@ class PackageDependency(Base):
|
|||
_OfficialProvider.Name == self.DepName).exists()
|
||||
return db.query(pkg).scalar() or db.query(official).scalar()
|
||||
|
||||
def provides(self) -> List[PackageRelation]:
|
||||
def provides(self) -> list[PackageRelation]:
|
||||
from aurweb.models.relation_type import PROVIDES_ID
|
||||
|
||||
rels = db.query(PackageRelation).join(_Package).filter(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import hashlib
|
||||
|
||||
from typing import List, Set
|
||||
from typing import Set
|
||||
|
||||
import bcrypt
|
||||
|
||||
|
@ -149,7 +149,7 @@ class User(Base):
|
|||
return self.session.SessionID
|
||||
|
||||
def has_credential(self, credential: Set[int],
|
||||
approved: List["User"] = list()):
|
||||
approved: list["User"] = list()):
|
||||
from aurweb.auth.creds import has_credential
|
||||
return has_credential(self, credential, approved)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue