Admin users can credit accounts

This commit is contained in:
Ben Arc
2022-01-31 16:29:42 +00:00
parent f5069f9699
commit dbab181759
14 changed files with 137 additions and 26 deletions
+8 -1
View File
@@ -14,7 +14,12 @@ from lnbits.core import db
from lnbits.core.models import User
from lnbits.decorators import check_user_exists
from lnbits.helpers import template_renderer, url_for
from lnbits.settings import LNBITS_ALLOWED_USERS, LNBITS_SITE_TITLE, SERVICE_FEE
from lnbits.settings import (
LNBITS_ALLOWED_USERS,
LNBITS_ADMIN_USERS,
LNBITS_SITE_TITLE,
SERVICE_FEE,
)
from ..crud import (
create_account,
@@ -113,6 +118,8 @@ async def wallet(
return template_renderer().TemplateResponse(
"error.html", {"request": request, "err": "User not authorized."}
)
if LNBITS_ADMIN_USERS and user_id in LNBITS_ADMIN_USERS:
user.admin = True
if not wallet_id:
if user.wallets and not wallet_name:
wallet = user.wallets[0]