mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 14:40:47 +01:00
refactor: use check_admin
decorator
This commit is contained in:
parent
3ed2b3cdeb
commit
1b07768b76
1 changed files with 3 additions and 8 deletions
|
@ -70,15 +70,10 @@ async def extensions(
|
|||
)
|
||||
async def extensions_install(
|
||||
request: Request,
|
||||
user: User = Depends(check_user_exists), # type: ignore
|
||||
activate: str = Query(None), # type: ignore
|
||||
deactivate: str = Query(None), # type: ignore
|
||||
user: User = Depends(check_admin),
|
||||
activate: str = Query(None),
|
||||
deactivate: str = Query(None),
|
||||
):
|
||||
if not user.admin:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.UNAUTHORIZED, detail="Only for admin users"
|
||||
)
|
||||
|
||||
try:
|
||||
extension_list: List[
|
||||
InstallableExtension
|
||||
|
|
Loading…
Add table
Reference in a new issue