diff --git a/lnbits/extensions/splitpayments/__init__.py b/lnbits/extensions/splitpayments/__init__.py index 33062425b..b1e0fbdfd 100644 --- a/lnbits/extensions/splitpayments/__init__.py +++ b/lnbits/extensions/splitpayments/__init__.py @@ -8,11 +8,11 @@ from lnbits.tasks import catch_everything_and_restart db = Database("ext_splitpayments") -copilot_static_files = [ +splitpayments_static_files = [ { - "path": "/copilot/static", + "path": "/splitpayments/static", "app": StaticFiles(directory="lnbits/extensions/splitpayments/static"), - "name": "copilot_static", + "name": "splitpayments_static", } ] splitpayments_ext: APIRouter = APIRouter( diff --git a/lnbits/extensions/splitpayments/tasks.py b/lnbits/extensions/splitpayments/tasks.py index 2f8d862fe..1a1b83aad 100644 --- a/lnbits/extensions/splitpayments/tasks.py +++ b/lnbits/extensions/splitpayments/tasks.py @@ -3,7 +3,7 @@ import json from lnbits.core.models import Payment from lnbits.core.crud import create_payment from lnbits.core import db as core_db -from lnbits.tasks import register_invoice_listener, internal_invoice_paid +from lnbits.tasks import register_invoice_listener # , internal_invoice_paid from lnbits.helpers import urlsafe_short_hash from .crud import get_targets @@ -78,4 +78,5 @@ async def on_invoice_paid(payment: Payment) -> None: ) # manually send this for now - await internal_invoice_paid.send(internal_checking_id) + # await internal_invoice_paid.send(internal_checking_id) + return diff --git a/lnbits/extensions/splitpayments/views_api.py b/lnbits/extensions/splitpayments/views_api.py index 33ed266a2..7e43d3a70 100644 --- a/lnbits/extensions/splitpayments/views_api.py +++ b/lnbits/extensions/splitpayments/views_api.py @@ -33,14 +33,14 @@ async def api_targets_set( data: TargetPut, wallet: WalletTypeInfo = Depends(WalletAdminKeyChecker()) ): targets = [] - for entry in data["targets"]: - wallet = await get_wallet(entry["wallet"]) + for entry in data.targets: + wallet = await get_wallet(entry.wallet) if not wallet: - wallet = await get_wallet_for_key(entry["wallet"], "invoice") + wallet = await get_wallet_for_key(entry.wallet, "invoice") if not wallet: raise HTTPException( status_code=HTTPStatus.BAD_REQUEST, - detail=f"Invalid wallet '{entry['wallet']}'.", + detail=f"Invalid wallet '{entry.wallet}'.", ) if wallet.id == wallet.wallet.id: @@ -49,14 +49,14 @@ async def api_targets_set( detail="Can't split to itself.", ) - if entry["percent"] < 0: + if entry.percent < 0: raise HTTPException( status_code=HTTPStatus.BAD_REQUEST, - detail=f"Invalid percent '{entry['percent']}'.", + detail=f"Invalid percent '{entry.percent}'.", ) targets.append( - Target(wallet.id, wallet.wallet.id, entry["percent"], entry["alias"] or "") + Target(wallet.id, wallet.wallet.id, entry.percent, entry.alias or "") ) percent_sum = sum([target.percent for target in targets])