mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
Fix errors reported by mypy
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f3ba709d21
commit
bfd0544ff8
13 changed files with 68 additions and 71 deletions
|
|
@ -74,11 +74,12 @@ class Auth(abc.ABC): # export
|
|||
@classmethod
|
||||
def load(cls, conf: Config, tp: str='') -> Self:
|
||||
if tp == '':
|
||||
tp = conf.get('type')
|
||||
if tp is None:
|
||||
val = conf.get('type')
|
||||
if val is None:
|
||||
msg = f'No type specified in auth configuration'
|
||||
conf.dump(ERR, msg)
|
||||
raise Exception(msg)
|
||||
tp = val
|
||||
return load_object(f'jwutils.auth.{tp}.Auth', Auth, 'Auth', conf)
|
||||
|
||||
def __init__(self, conf: Config):
|
||||
|
|
@ -112,7 +113,7 @@ class Auth(abc.ABC): # export
|
|||
return self._user(name)
|
||||
|
||||
@abc.abstractmethod
|
||||
def _users(self) -> list[User]:
|
||||
def _users(self) -> dict[str, User]:
|
||||
raise NotImplementedError
|
||||
|
||||
def _user_by_email(self, email: str) -> User:
|
||||
|
|
@ -128,7 +129,7 @@ class Auth(abc.ABC): # export
|
|||
return self._user_by_email(email)
|
||||
|
||||
@property
|
||||
def users(self) -> list[User]:
|
||||
def users(self) -> dict[str, User]:
|
||||
return self._users()
|
||||
|
||||
@abc.abstractmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue