fixup types
This commit is contained in:
parent
9cecd42467
commit
a7c10dde4a
2
.github/workflows/mypy.yml
vendored
2
.github/workflows/mypy.yml
vendored
|
@ -10,4 +10,4 @@ jobs:
|
||||||
- uses: jpetrucciani/mypy-check@master
|
- uses: jpetrucciani/mypy-check@master
|
||||||
with:
|
with:
|
||||||
mypy_flags: '--install-types --non-interactive'
|
mypy_flags: '--install-types --non-interactive'
|
||||||
path: lnbits
|
path: 'lnbits'
|
||||||
|
|
|
@ -55,9 +55,9 @@ async def home(request: Request, lightning: str = None):
|
||||||
)
|
)
|
||||||
async def extensions(
|
async def extensions(
|
||||||
request: Request,
|
request: Request,
|
||||||
user=Depends(check_user_exists),
|
user: User = Depends(check_user_exists), #type: ignore
|
||||||
enable=Query(None),
|
enable: str = Query(None), #type: ignore
|
||||||
disable=Query(None),
|
disable: str = Query(None), #type: ignore
|
||||||
):
|
):
|
||||||
extension_to_enable = enable
|
extension_to_enable = enable
|
||||||
extension_to_disable = disable
|
extension_to_disable = disable
|
||||||
|
@ -108,11 +108,12 @@ just **user_id**: return the first user wallet or create one if none found (with
|
||||||
nothing: create everything<br>
|
nothing: create everything<br>
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
async def wallet(
|
async def wallet(
|
||||||
request=Query(None),
|
request=Query(None),
|
||||||
nme=Query(None),
|
nme: Optional[str] = Query(None), #type: ignore
|
||||||
usr=Query(None),
|
usr: Optional[UUID4] = Query(None), #type: ignore
|
||||||
wal=Query(None),
|
wal: Optional[UUID4] = Query(None), #type: ignore
|
||||||
):
|
):
|
||||||
user_id = usr.hex if usr else None
|
user_id = usr.hex if usr else None
|
||||||
wallet_id = wal.hex if wal else None
|
wallet_id = wal.hex if wal else None
|
||||||
|
|
|
@ -122,8 +122,8 @@ api_key_query = APIKeyQuery(
|
||||||
|
|
||||||
async def get_key_type(
|
async def get_key_type(
|
||||||
r: Request,
|
r: Request,
|
||||||
api_key_header=Security(api_key_header),
|
api_key_header: str = Security(api_key_header), #type: ignore
|
||||||
api_key_query=Security(api_key_query),
|
api_key_query: str = Security(api_key_query) #type: ignore
|
||||||
) -> WalletTypeInfo:
|
) -> WalletTypeInfo:
|
||||||
# 0: admin
|
# 0: admin
|
||||||
# 1: invoice
|
# 1: invoice
|
||||||
|
@ -180,8 +180,8 @@ async def get_key_type(
|
||||||
|
|
||||||
async def require_admin_key(
|
async def require_admin_key(
|
||||||
r: Request,
|
r: Request,
|
||||||
api_key_header=Security(api_key_header),
|
api_key_header: str = Security(api_key_header), #type: ignore
|
||||||
api_key_query=Security(api_key_query),
|
api_key_query: str = Security(api_key_query) #type: ignore
|
||||||
):
|
):
|
||||||
token = api_key_header if api_key_header else api_key_query
|
token = api_key_header if api_key_header else api_key_query
|
||||||
|
|
||||||
|
@ -199,8 +199,8 @@ async def require_admin_key(
|
||||||
|
|
||||||
async def require_invoice_key(
|
async def require_invoice_key(
|
||||||
r: Request,
|
r: Request,
|
||||||
api_key_header=Security(api_key_header),
|
api_key_header: str = Security(api_key_header), #type: ignore
|
||||||
api_key_query=Security(api_key_query),
|
api_key_query: str = Security(api_key_query) #type: ignore
|
||||||
):
|
):
|
||||||
token = api_key_header if api_key_header else api_key_query
|
token = api_key_header if api_key_header else api_key_query
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user