fix balance endpoint (request/balance)

This commit is contained in:
2026-09-30 07:06:58 -07:00
parent c7f40bea76
commit 8afc1c6b24

2
app.py
View File

@@ -284,7 +284,7 @@ def sms_guard():
con = db(); now = int(time.time()) con = db(); now = int(time.time())
ip = request.headers.get("X-Real-IP") or request.remote_addr or "?" ip = request.headers.get("X-Real-IP") or request.remote_addr or "?"
# balance: refuse if house SMSPool balance below $5 # balance: refuse if house SMSPool balance below $5
st, b = sms_api("balance") st, b = sms_api("request/balance")
bal = jf(b) or {} bal = jf(b) or {}
try: bal = float(bal.get("balance", 0)) try: bal = float(bal.get("balance", 0))
except Exception: bal = 0 except Exception: bal = 0