lnbits/extensions/streamalerts/views_api.py
async def api_delete_donation(donation_id, g: WalletTypeInfo = Depends(get_key_type)):
    """Delete the donation with the given donation_id"""
    donation = await get_donation(donation_id)
    if not donation:
        raise HTTPException(
            status_code=HTTPStatus.NOT_FOUND, detail="No donation with this ID!"
        )
    if donation.wallet != g.wallet.id:
        raise HTTPException(
            status_code=HTTPStatus.FORBIDDEN,
            detail="Not authorized to delete this donation!",
        )
    await delete_donation(donation_id)
    raise HTTPException(status_code=HTTPStatus.NO_CONTENT)
Delete the donation with the given donation_id
Delete the donation with the given donation_id
Delete the donation with the given donation_id
async def api_delete_donation(donation_id, g: WalletTypeInfo = Depends(get_key_type)):
    donation = await get_donation(donation_id)
    if not donation:
        raise HTTPException(
            status_code=HTTPStatus.NOT_FOUND, detail="No donation with this ID!"
        )
    if donation.wallet != g.wallet.id:
        raise HTTPException(
            status_code=HTTPStatus.FORBIDDEN,
            detail="Not authorized to delete this donation!",
        )
    await delete_donation(donation_id)
    raise HTTPException(status_code=HTTPStatus.NO_CONTENT)
async def api_delete_donation ( donation_id , g : WalletTypeInfo = Depends ( get_key_type ) ) : donation = await get_donation ( donation_id ) if not donation : raise HTTPException ( status_code = HTTPStatus . NOT_FOUND , detail = "No donation with this ID!" ) if donation . wallet != g . wallet . id : raise HTTPException ( status_code = HTTPStatus . FORBIDDEN , detail = "Not authorized to delete this donation!" , ) await delete_donation ( donation_id ) raise HTTPException ( status_code = HTTPStatus . NO_CONTENT )
Delete the donation with the given donation_id
Delete the donation with the given donation_id
"""Delete the donation with the given donation_id"""
donation_id
g
WalletTypeInfo