refactor: fix duplicate keychecker (#2339)
* refactor: fix duplicate keychecker - refactor KeyChecker to be more approachable - only 1 sql query needed even if you use `get_key_type` - rename `WalletType` to `KeyType` wallet type was misleading fix test sorting * fixup! * revert 404
This commit is contained in:
@@ -26,11 +26,11 @@ from lnbits.core.models import (
|
||||
CreateInvoice,
|
||||
CreateLnurl,
|
||||
DecodePayment,
|
||||
KeyType,
|
||||
Payment,
|
||||
PaymentFilters,
|
||||
PaymentHistoryPoint,
|
||||
Wallet,
|
||||
WalletType,
|
||||
)
|
||||
from lnbits.db import Filters, Page
|
||||
from lnbits.decorators import (
|
||||
@@ -252,7 +252,7 @@ async def api_payments_create(
|
||||
wallet: WalletTypeInfo = Depends(require_invoice_key),
|
||||
invoice_data: CreateInvoice = Body(...),
|
||||
):
|
||||
if invoice_data.out is True and wallet.wallet_type == WalletType.admin:
|
||||
if invoice_data.out is True and wallet.key_type == KeyType.admin:
|
||||
if not invoice_data.bolt11:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.BAD_REQUEST,
|
||||
|
||||
Reference in New Issue
Block a user