Skip to content

Commit f3334bc

Browse files
committed
cleanup
1 parent a9605fe commit f3334bc

File tree

7 files changed

+1
-18
lines changed

7 files changed

+1
-18
lines changed

helpers.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import httpx
22
from lnbits.core.views.api import api_lnurlscan
3-
from loguru import logger
43

54

65
async def get_pr(ln_address, amount):
7-
logger.debug(ln_address)
8-
logger.debug(amount)
96
try:
107
data = await api_lnurlscan(ln_address)
118
if data.get("status") == "ERROR":
@@ -15,7 +12,6 @@ async def get_pr(ln_address, amount):
1512
url=f"{data['callback']}?amount={int(amount) * 1000}"
1613
)
1714
if response.status_code != 200:
18-
logger.debug(response.status_code)
1915
return
2016
return response.json()["pr"]
2117
except Exception:

models.py

-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class CreateTposData(BaseModel):
3535
withdraw_pin_disabled: bool = Field(False)
3636
lnaddress: bool = Field(False)
3737
lnaddress_cut: Optional[int] = Field(0)
38-
user_lnaddress: Optional[str] = Field(None)
3938

4039

4140
class TposClean(BaseModel):
@@ -53,7 +52,6 @@ class TposClean(BaseModel):
5352
withdrawn_amount: int = 0
5453
lnaddress: Optional[bool] = None
5554
lnaddress_cut: int = 0
56-
user_lnaddress: Optional[str] = None
5755
items: Optional[str] = None
5856
tip_options: Optional[str] = None
5957

static/js/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ window.app = Vue.createApp({
191191
this.g.user.wallets[0].inkey
192192
)
193193
.then(function (response) {
194-
console.log('getTposs', response.data)
195194
self.tposs = response.data.map(function (obj) {
196195
return mapTpos(obj)
197196
})

static/js/tpos.js

-2
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ window.app = Vue.createApp({
482482
if (this.lnaddress) {
483483
params.user_lnaddress = this.lnaddressDialog.lnaddress
484484
}
485-
console.log(params)
486-
487485
axios
488486
.post(`/tpos/api/v1/tposs/${this.tposId}/invoices`, params)
489487
.then(response => {

tasks.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,17 @@ async def on_invoice_paid(payment: Payment) -> None:
4141

4242
tpos = await get_tpos(tpos_id)
4343
assert tpos
44-
logger.debug(payment.extra.get("lnaddress"))
4544
if payment.extra.get("lnaddress") and payment.extra["lnaddress"] != "":
46-
logger.debug("poo")
4745
calc_amount = payment.amount - ((payment.amount / 100) * tpos.lnaddress_cut)
48-
logger.debug(calc_amount)
4946
pr = await get_pr(payment.extra.get("lnaddress"), calc_amount / 1000)
50-
logger.debug(pr)
5147
if pr:
5248
payment.extra["lnaddress"] = ""
5349
paid_payment = await pay_invoice(
5450
payment_request=pr,
5551
wallet_id=payment.wallet_id,
5652
extra={**payment.extra},
5753
)
58-
logger.debug(f"tpos: tip invoice paid: {paid_payment.checking_id}")
54+
logger.debug(f"tpos: LNaddress paid cut: {paid_payment.checking_id}")
5955

6056
await websocket_updater(tpos_id, str(stripped_payment))
6157

views.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from lnbits.decorators import check_user_exists
77
from lnbits.helpers import template_renderer
88
from lnbits.settings import settings
9-
from loguru import logger
109
from starlette.responses import HTMLResponse
1110

1211
from .crud import get_clean_tpos, get_tpos
@@ -29,7 +28,6 @@ async def index(request: Request, user: User = Depends(check_user_exists)):
2928
@tpos_generic_router.get("/{tpos_id}")
3029
async def tpos(request: Request, tpos_id, lnaddress: Optional[str] = ""):
3130
tpos = await get_tpos(tpos_id)
32-
logger.debug(tpos)
3331
if not tpos:
3432
raise HTTPException(
3533
status_code=HTTPStatus.NOT_FOUND, detail="TPoS does not exist."

views_api.py

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
)
1818
from lnbits.utils.exchange_rates import get_fiat_rate_satoshis
1919
from lnurl import decode as decode_lnurl
20-
from loguru import logger
2120

2221
from .crud import (
2322
create_tpos,
@@ -293,7 +292,6 @@ async def api_tpos_atm_pay(
293292
detail=str(exc),
294293
) from exc
295294
except Exception as exc:
296-
logger.warning(exc)
297295
raise HTTPException(
298296
status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
299297
detail="Cannot process atm withdraw",

0 commit comments

Comments
 (0)